Quickstart
Get started with the 638Labs API in three steps: get a key, call a native agent, then register your own endpoint.
1. Get an API Key
-
Visit 638Labs.com and create an account.
-
Go to the API Keys section in your dashboard sidebar. Create an API key or use the default one created with your account.
-
Copy the API key to your clipboard (reveal key in the right-hand action menu to copy).
-
Set the environment variable in your terminal:
export STOLABS_API_KEY=<your-api-key>We use
STOas shorthand for638- API variable names can’t start with numbers.
2. Call a Native Agent
638Labs has native agents you can call immediately. Let’s try stolabs/BulletBot, a summarization agent:
curl -s https://sto0.638labs.com/api/v1 \ -H "Content-Type: application/json" \ -H "X-Stolabs-Api-Key: $STOLABS_API_KEY" \ -H "X-Stolabs-Route-Name: stolabs/BulletBot" \ -d '{ "messages": [ { "role": "user", "content": "Summarize: Large language models are trained on vast amounts of text data. They learn patterns in language that allow them to generate coherent text, answer questions, and perform a variety of natural language tasks. These models have become foundational components in modern AI applications." } ] }'The response follows the OpenAI chat.completion format:
{ "choices": [ { "message": { "role": "assistant", "content": "• LLMs train on large text datasets to learn language patterns\n• Capable of text generation, Q&A, and NLP tasks\n• Now foundational to modern AI applications" } } ]}Try other native agents by changing the X-Stolabs-Route-Name header - for example, stolabs/TLDRBot for a 2-sentence summary, or stolabs/QuickChat for a conversational response. See the full list at Native Agents.
3. Register Your Own Endpoint
Now route a request through 638Labs to your own AI provider - for example, OpenAI.
Claim your route namespace
Every endpoint you register lives under a namespace prefix unique to your account (e.g. myorg/). You need to claim this once before creating endpoints.
- In the dashboard, go to Profile (bottom of the sidebar).
- In the Route Namespace card, enter your desired prefix (lowercase, letters/numbers/hyphens, 2-30 characters).
- Click Claim. This is permanent - choose carefully.
Your prefix becomes the first part of every route name you create: myorg/agent-name.
Create a registry entry
- Click Endpoints in the sidebar.
- Click New Endpoint.
- Your namespace prefix is pre-filled. Enter the endpoint name and details:
Route Name: myorg/openai-gpt4o (prefix is automatic)URL: https://api.openai.com/v1/chat/completionsType: AI ModelRoute names follow a prefix/name format (e.g. myorg/openai-gpt4o).
Test it
Set your OpenAI key alongside your 638Labs key:
export OPENAI_API_KEY=<your-openai-key>Then call your registered endpoint through the gateway:
curl -s https://sto0.638labs.com/api/v1 \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "X-Stolabs-Api-Key: $STOLABS_API_KEY" \ -H "X-Stolabs-Route-Name: myorg/openai-gpt4o" \ -d '{ "model": "gpt-4o", "messages": [ { "role": "user", "content": "Write a one-sentence bedtime story about a unicorn." } ] }'The gateway routes your request to OpenAI through your registered endpoint. Your 638Labs API key handles auth with the gateway; your OpenAI key is passed through to OpenAI via the Authorization header.
Next Steps
- Browse Native Agents to see all 18 agents available for testing
- Read the AI Registry docs for the full registration walkthrough with screenshots
- Check the AI Gateway docs for authentication patterns and routing details
- See Rate Limits for free and paid tier limits