API ReferenceLLM Keys

Upsert user LLM key

PUT
/api/v1/llm/keys

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication. Include your API key in the Authorization header as Bearer rf_your_key.

In: header

Request Body

application/json

api_key?string

API key for the provider (leave empty to keep existing)

base_url?string

Base URL for the provider (for Ollama or custom endpoints)

is_enabled*boolean

Whether this provider is enabled

provider*string

LLM provider name

Value in"openrouter" | "anthropic" | "openai" | "ollama"
[key: string]?never

Response Body

application/json

application/problem+json

curl -X PUT "http://localhost:8080/api/v1/llm/keys" \  -H "Content-Type: application/json" \  -d '{    "is_enabled": true,    "provider": "openrouter"  }'
{
  "base_url": "string",
  "created_at": "string",
  "has_key": true,
  "id": "string",
  "is_enabled": true,
  "provider": "string",
  "updated_at": "string"
}
{
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}