TokAPI Docs

API Reference

Endpoints, authentication, and examples for the TokAPI gateway.

Base URL

https://api.tokapi.ai

Authentication

Send your TokAPI key as a Bearer token:

Authorization: Bearer sk-lazytech-...

The x-api-key: sk-lazytech-... header is also accepted. Public endpoints require no authentication.

Public endpoints

No authentication required.

MethodPathDescription
GET/v1/pingHealth check.
GET/v1/modelsList the full model catalog.
GET/v1/models/{model}Retrieve a single model.

OpenAI-compatible endpoints

Require a Bearer key.

MethodPathDescription
POST/v1/responsesCreate a response (Responses API).
GET/v1/responses/{response_id}Retrieve a response.
POST/v1/chat/completionsChat Completions API.
POST/v1/conversationsCreate a conversation.
GET/v1/conversations/{conversation_id}Retrieve a conversation.
POST/v1/conversations/{conversation_id}Update a conversation.
DELETE/v1/conversations/{conversation_id}Delete a conversation.

Claude-compatible endpoints

Require a Bearer key.

MethodPathDescription
POST/v1/messagesAnthropic Messages API.
POST/v1/messages/count_tokensCount tokens for a message request.

Files

Require a Bearer key.

MethodPathDescription
POST/v1/filesUpload a file (multipart).
PUT/v1/files/{path}Upload/replace a file (streaming body).

Usage

Require a Bearer key.

MethodPathDescription
GET/v1/usageBudget usage as percentages. See Usage API.

Example — POST /v1/responses

curl https://api.tokapi.ai/v1/responses \
  -H "Authorization: Bearer sk-lazytech-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "input": "Summarize the theory of relativity in one sentence."
  }'

Example — POST /v1/messages

curl https://api.tokapi.ai/v1/messages \
  -H "Authorization: Bearer sk-lazytech-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 1024,
    "messages": [{ "role": "user", "content": "Hello, Claude!" }]
  }'

Set "stream": true on either endpoint to receive Server-Sent Events.

Error codes

StatusMeaning
400Invalid request body or model.
401Missing or invalid API key.
402Budget or rate window exhausted.
403Key disabled, expired, or not permitted.
404Resource not found.
429Rate limited.
500Server error.
502Upstream provider failure.
503Feature or capacity unavailable.

On this page