FunkyRouter Docs

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.
  • curl in 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

  1. Sign in to FunkyRouter.
  2. Open API keys.
  3. In Inference key, enter a descriptive name such as Local development.
  4. Select Create inference key.
  5. 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 seeWhat to check
Authentication errorConfirm the Authorization header starts with Bearer and the key has not been revoked.
Permission errorConfirm you created an inference key, not a management key.
Model errorCopy the current ID from Models and retry.
Service unavailableThe 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_MODEL

Last updated on

On this page