Chapter 4: Free Labs Access and CodeCloud Keyspace API Setup¶
Video: Watch this chapter on YouTube (38:20)
Overview¶
This chapter explains how to access free hands-on labs for the course and how to obtain API keys for various LLMs through CodeCloud Keyspace. The labs provide a browser-based environment requiring no setup or credit cards, allowing learners to practice building AI agents with real API access.
Detailed Summary¶
Free Labs Access¶
The course includes challenge-based labs that can be accessed directly in your browser:
- No setup required: Everything runs in the browser
- No credit cards needed: Labs are free to access
- Challenge-based learning: Each lab presents a challenge to solve
- Sign up link: Available in the course description
The Need for API Keys¶
When building AI agents on n8n, you need API access to LLMs. There are several ways to obtain API keys:
- OpenAI Platform: Direct from OpenAI (requires payment info)
- OpenRouter: Aggregator for multiple models (requires payment info)
- CodeCloud Keyspace: All-in-one AI playground (included with course subscription)
CodeCloud Keyspace Overview¶
CodeCloud Keyspace is an all-in-one AI playground that provides API keys for multiple LLMs:
Available Models (at time of recording):¶
- GPT-4o
- GPT-4.1
- Claude Sonnet 4
- Gemini 2.5
- Grok 3
Subscription Plans¶
- Most access with AI plans and Business plan
- Various subscription levels available
Accessing CodeCloud Keyspace¶
- Navigate to:
codecloud.com/ai-playground/codekey - Click "Launch Now"
- Click "Start Playground"
- Dashboard displays available models and access methods
Method 1: Using CodeKey with OpenAI Node¶
This method uses the native OpenAI node with CodeKey credentials:
Step 1: Set Up Workflow¶
- Create a chat trigger node
- Add an OpenAI "Message Model" node
- Connect them together
Step 2: Configure Credentials¶
- Click "Create new credential"
- Name it (e.g., "CodeKey Demo")
- For Base URL: Copy from CodeKey dashboard and paste
- For API Key: Copy from CodeKey dashboard and paste
- Click Save
Note: A red bar may appear due to UI incompatibility—this is normal.
Step 3: Select Model¶
- Under Model, choose "By ID" (not "Pick from list")
- Type the model name exactly:
openai/gpt-4.1 - This format is required because the model list won't load correctly
Step 4: Test the Connection¶
- Drag chat input into the prompt field
- Execute the step
- Example: Ask "Why is the color of the sea blue?"
- Response confirms the connection works
Method 2: Using CodeKey with HTTP Request Node¶
This method uses raw HTTP requests to the CodeKey API:
Step 1: Get the cURL Command¶
- In CodeKey dashboard, toggle to "curl command" view
- Copy the entire curl command
Step 2: Import into n8n¶
- Add an HTTP Request node
- Click "Import cURL"
- Paste the entire curl command
- All fields are automatically configured
Step 3: Understanding the Configuration¶
- Method: POST
- URL: CodeKey API endpoint
- Headers: Authentication included
- Body: JSON with model and prompt
The pre-configured content asks: "Why should someone choose CodeCloud over other platforms to learn DevOps?"
Step 4: Execute and Review¶
- Execute the step
- Response appears in the output
- Example response: "Someone should choose CodeCloud because it offers highly interactive, hands-on labs, and real-world scenario-based exercises..."
Authentication Header Details¶
When using the HTTP node method, the authentication is configured in the headers: - Name: Authorization - Value: Bearer [API_KEY]
For better security practices, set up a proper credential type (covered in later chapters).
Best Practices for API Key Management¶
- Use credential types: Store API keys securely in n8n's credential system
- Don't hardcode keys: Avoid pasting keys directly in node parameters
- Create reusable credentials: Set up once, use across multiple nodes and workflows
- Security for teams: Credential storage protects keys when sharing workflows
Choosing Your API Key Source¶
| Source | Pros | Cons |
|---|---|---|
| CodeCloud Keyspace | Included with course, multiple models, easy setup | Requires subscription |
| OpenAI Direct | Official source, always current | Requires payment info, per-model pricing |
| OpenRouter | Multiple providers, unified API | Requires payment info |
Upcoming Sections Preview¶
The chapter mentions that upcoming sections will cover: - Getting OpenAI API keys from the OpenAI developer platform - Setting up Google OAuth for Gmail, Drive, and Sheets - Authentication best practices for HTTP requests - Proper credential management in n8n
Key Takeaways¶
-
Free labs require no setup: Browser-based labs provide hands-on practice without installation or credit cards.
-
Multiple API key sources: Choose between CodeCloud Keyspace, OpenAI directly, or OpenRouter based on your needs.
-
CodeKey provides unified access: One platform for multiple LLM providers simplifies API management.
-
Two connection methods: Use either the native OpenAI node or HTTP Request node with CodeKey.
-
Model selection by ID: When using CodeKey, always select models "By ID" and type the exact model name.
-
Import cURL for quick setup: The HTTP node can import cURL commands directly, auto-configuring all fields.
-
Security matters: Use n8n's credential system rather than hardcoding API keys.
-
Base URL replacement: CodeKey uses a custom base URL that replaces the default OpenAI URL.
-
Challenge-based learning: Labs present real challenges to solve, reinforcing practical skills.
-
Subscription options: Full API access is available through various CodeCloud subscription tiers.
Conclusion¶
This chapter bridges the gap between learning concepts and practicing with real API access. CodeCloud Keyspace eliminates the barrier of needing separate accounts and payment information for each LLM provider, allowing learners to focus on building workflows rather than managing multiple API accounts. The two methods shown—native OpenAI node and HTTP Request node—provide flexibility based on use case requirements. Understanding how to obtain and configure API keys is essential groundwork for all the AI-powered workflows covered in subsequent chapters. With free lab access and CodeKey API credentials, learners have everything needed to practice building sophisticated AI agents.