FunkyRouter DocsBeta

Quickstart

Create an inference key and send your first request to the FunkyRouter API with the cabeza-latest model.

FunkyRouter is an OpenAI-compatible inference API. You can use it with an OpenAI SDK or with any HTTP client.

ItemValue
Base URLhttps://api.funkyrouter.ai/v1
Recommended model IDcabeza-latest
AuthenticationAuthorization: Bearer <inference key>
Context window1,048,576 tokens (prompt plus output)
Maximum outputUp to the context window, less the prompt. No default.
InputText and images. See Images.
OutputText

Beta service

FunkyRouter is in beta. A valid key does not mean that a node is ready at all times. If you get HTTP 503, examine service status and try again.

Before you start

You must have:

  • A FunkyRouter account with an active workspace.
  • An active FunkyRouter Credits plan in that workspace. To start the plan, go to Billing. The page shows the current price.
  • Permission to manage API keys in the workspace. If you cannot create a key, speak to a workspace administrator.

Send your first request

Create an inference key

  1. Sign in and go to API keys.
  2. In Inference key, type a name, for example Local development.
  3. Select Create inference key.
  4. Copy the key. FunkyRouter shows the full key one time only.

Use an inference key for model requests. A management key cannot send model requests. If you use one, the API returns HTTP 403.

Keep the key in an environment variable

export FUNKYROUTER_API_KEY="paste-your-inference-key-here"

Do not put the key in source control or in browser code. For a deployed application, keep the key in a secrets manager.

Send a chat completion

curl https://api.funkyrouter.ai/v1/chat/completions \
  --header "Authorization: Bearer $FUNKYROUTER_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "cabeza-latest",
    "messages": [
      { "role": "user", "content": "Say hello from Texas." }
    ]
  }'

Read the response

A successful request returns HTTP 200. The choices array holds the assistant message. The usage object holds the token counts.

{
  "id": "chatcmpl-…",
  "object": "chat.completion",
  "model": "cabeza-latest",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Howdy from Texas!" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 14, "completion_tokens": 6, "total_tokens": 20 }
}

Each response has an X-Request-ID header. Give this ID when you report a problem.

If the request fails

StatusCauseAction
400The body has a field that the API does not accept, or the model ID is incorrect.Remove the field. Use cabeza-latest. See Chat completions.
401The key is incorrect, revoked or missing.Make sure the header is Authorization: Bearer <key>.
402The workspace has no active plan or not sufficient credit.Go to Billing.
403The key is a management key.Create an inference key.
503No node is ready.Wait, then try again.

All error codes are in Errors and limits.

Remove the key from the shell

When you complete your tests, remove the key:

unset FUNKYROUTER_API_KEY

Next steps

Last updated on

On this page