DocsAPI Reference

Overview

Connect your application to AI models through the Tokamak API.


Use one Tokamak API key to call the models available in your workspace. Start with a small request, then add streaming or tools as your application needs them.

API base URL

https://api.tokamak.sh/v1

Send your key in the Authorization header:

Authorization: Bearer YOUR_TOKAMAK_API_KEY

Keep the key in your server or local application's environment. See Authentication for setup.

Start building

  1. Quickstart: create a key and send your first request.
  2. Models: find a model ID.
  3. Chat, Responses and Messages: choose the endpoint your model supports.
  4. Streaming: display output as it arrives.

Endpoints

MethodPathUse it to
GET/modelsList available models
POST/chat/completionsGenerate a chat response
POST/responsesUse the Responses format
POST/messagesUse the Anthropic Messages format
GET/generation?id=…Inspect one request's usage and billing status
GET/usage/meRead your usage summary

Paths in this table are relative to the API base URL. The model and its provider determine supported request formats and optional features.

Common request settings

SettingPurpose
modelPublic model ID from the model list
messages or inputYour prompt and conversation, using the chosen endpoint's format
Output limitBound the response length using that endpoint's supported token-limit field
streamSet to true to receive incremental output

Tokamak uses the selected endpoint's native response format. Your application handles any tool calls returned by the model.

On this page