OneKeyLLM

API Reference

Short reference for the /v1 endpoints exposed by OneKeyLLM.

Base URL:

https://api.tokapi.ai

User authentication:

Authorization: Bearer sk-lazytech-...

Admin endpoints use a separate admin bearer. Public endpoints such as /v1/models and /v1/ping do not require a bearer according to the OpenAPI schema.

Runtime

MethodPathDescription
GET/v1/pingAPI ping.
GET/v1/modelsList the model catalog.
GET/v1/models/{model}Retrieve one model metadata.

OpenAI-compatible

MethodPathDescription
POST/v1/responsesCreate a Responses API response, with SSE when stream=true.
GET/v1/responses/{response_id}Retrieve a response.
POST/v1/chat/completionsForward Chat Completions to the configured upstream.
POST/v1/conversationsCreate a conversation container.
GET/v1/conversations/{conversation_id}Retrieve a conversation.
POST/v1/conversations/{conversation_id}Update a conversation.
DELETE/v1/conversations/{conversation_id}Delete a conversation.

Responses example

curl https://api.tokapi.ai/v1/responses \
  -H "Authorization: Bearer $ONEKEYLLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4",
    "input": "Write a one sentence release note."
  }'

The minimal body requires model. input can contain text, messages, images, files, or tool results depending on the Responses format you use.

Claude-compatible

MethodPathDescription
POST/v1/messagesCreate a Claude message through Anthropic Messages.
POST/v1/messages/count_tokensCount Claude tokens.

Messages example

curl https://api.tokapi.ai/v1/messages \
  -H "Authorization: Bearer $ONEKEYLLM_API_KEY" \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 128,
    "messages": [{ "role": "user", "content": "Reply with ok" }]
  }'

Files

MethodPathDescription
POST/v1/filesUpload multipart form data.
PUT/v1/files/{path}Upload by streaming the request body.

Usage

MethodPathDescription
GET/v1/usageBudget for the authenticated API key.
GET/v1/usage/account_capacityEstimated remaining capacity per account.
POST/v1/usage/account_capacity/refreshRefresh the capacity estimate.

Auth dashboard

MethodPathDescription
POST/v1/auth/email/sendSend a login code.
POST/v1/auth/tokenCreate a user JWT.
GET/v1/auth/verifyVerify a user JWT.

Common errors

StatusMeaning
400Invalid body or unavailable model.
401Missing or invalid key.
402API key budget exhausted.
502Upstream failure.
503Provider, repository, or capacity unavailable.