Make your first API request
Create a FunkyRouter inference key and send one OpenAI-compatible chat completion request.
This quickstart takes you from a FunkyRouter account to one authenticated API response. It covers only client API access.
Before you begin
You need:
- A FunkyRouter account with an active workspace.
- Workspace permission to manage API keys. If the key controls are unavailable, ask a workspace administrator.
curlin your terminal.
FunkyRouter is in private beta. A valid key does not guarantee that a model is actively serving at every moment.
1. Create an inference key
- Sign in to FunkyRouter.
- Open API keys.
- In Inference key, enter a descriptive name such as
Local development. - Select Create inference key.
- Copy the full key immediately. FunkyRouter shows it only once.
Use an inference key for model requests. A management key cannot invoke models.
2. Store the key for this terminal session
Paste the key into an environment variable:
export FUNKYROUTER_API_KEY="paste-your-inference-key-here"Do not commit the key to source control or place it in client-side browser code. For a deployed application, store it in your platform's secrets manager.
3. Choose an available model
Open Models, copy an actively serving model ID, and store it for the request:
export FUNKYROUTER_MODEL="your-model-id"Model availability is the source of truth. Do not assume that an ID from an older example is still serving.
4. Call the chat completions API
Send an OpenAI-compatible request with the key as a bearer token:
curl --fail-with-body https://api.funkyrouter.ai/v1/chat/completions \
--header "Authorization: Bearer ${FUNKYROUTER_API_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"model\": \"${FUNKYROUTER_MODEL}\",
\"messages\": [
{ \"role\": \"user\", \"content\": \"Why is Texas a good place to build?\" }
]
}"A successful response has an HTTP 200 status and a choices array containing the assistant message. Request IDs, token counts, timing, status, and billing metadata may be retained for service operation; review the privacy notice for the current policy.
If the request fails
| What you see | What to check |
|---|---|
| Authentication error | Confirm the Authorization header starts with Bearer and the key has not been revoked. |
| Permission error | Confirm you created an inference key, not a management key. |
| Model error | Copy the current ID from Models and retry. |
| Service unavailable | The private-beta pool may not have an actively serving model. Check service status before retrying. |
When you finish testing, remove the key from the shell session:
unset FUNKYROUTER_API_KEY FUNKYROUTER_MODELLast updated on