TOKEN BOAT / 2026

DEVELOPER DOCS / API REFERENCE

EN / GLOBAL

FROM API KEYTO PRODUCTIONREQUEST.

A directly usable integration guide. Examples share one base URL, while the endpoint index stays contract-checked against the relay OpenAPI file in this repository.

01 / START

Quickstart

  1. Create an API key in the console.
  2. Copy a model ID from the public model catalog.
  3. Keep the key in a server-side environment variable and send the first request.

02 / AUTH

Authentication & base URL

Protected endpoints use a Bearer token. Never place API keys in browser code, public repositories, logs, or screenshots.

Base URLhttps://tokenboat.com/v1
Request headerAuthorization: Bearer $TOKEN_BOAT_API_KEY

03 / CALL

Three ways to call

Curl
export TOKEN_BOAT_API_KEY="your_api_key"
export MODEL_ID="choose_from_the_model_catalog"

curl https://tokenboat.com/v1/chat/completions \
  -H "Authorization: Bearer $TOKEN_BOAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "'"$MODEL_ID"'",
    "messages": [{"role": "user", "content": "Hello from Token Boat"}]
  }'
Python
from openai import OpenAI
import os

client = OpenAI(
    api_key=os.environ["TOKEN_BOAT_API_KEY"],
    base_url="https://tokenboat.com/v1",
)

response = client.chat.completions.create(
    model=os.environ["MODEL_ID"],
    messages=[{"role": "user", "content": "Hello from Token Boat"}],
)
print(response.choices[0].message.content)
JavaScript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.TOKEN_BOAT_API_KEY,
  baseURL: "https://tokenboat.com/v1",
});

const response = await client.chat.completions.create({
  model: process.env.MODEL_ID,
  messages: [{ role: "user", content: "Hello from Token Boat" }],
});
console.log(response.choices[0].message.content);

04 / STREAM

Streaming

Set stream: true for models that support streaming and consume the Server-Sent Events incrementally. Clients should handle disconnects and an incomplete final chunk.

const stream = await client.chat.completions.create({
  model: process.env.MODEL_ID,
  messages: [{ role: "user", content: "Stream a short answer" }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

05 / RECOVER

Errors & retries

Error responses include an HTTP status and message. Record request time, endpoint, model ID, and status—but never the full key or sensitive prompt content.

StatusMeaningAction
400Invalid request field or model parameterCorrect the request before retrying
401Missing, invalid, or expired API keyCheck the Authorization header and key status
403Account or model access is not allowedCheck account access and model availability
429Request or token limit reachedRespect Retry-After; use exponential backoff with jitter
5xxGateway or upstream temporarily unavailableUse limited retries only for safe, replayable requests

06 / LIMITS

Rate limits

RPM, TPM, and concurrency limits vary by account, model, and current policy, so this page does not hard-code a number that may become inaccurate. For a 429 response, use its headers and the account console as the source of truth.

  • Bound concurrency and configure client timeouts.
  • Use exponential backoff with jitter for 429 and temporary 5xx responses.
  • Do not blindly replay generation tasks; query task state first.
  • Use the support center when a production workload needs a higher limit.

07 / REFERENCE

Core endpoints

These are the main public endpoints. Check each model detail for the endpoint types actually supported by that model.

MethodPathPurpose
GET/v1/modelsList models available to the API key
POST/v1/responsesResponses API for tools and multi-turn workflows
POST/v1/chat/completionsOpenAI-compatible chat completions
POST/v1/messagesAnthropic Messages-compatible endpoint
POST/v1/embeddingsCreate text embeddings
POST/v1/images/generationsSubmit an image generation request
POST/v1/audio/speechText to speech
POST/v1/audio/transcriptionsAudio transcription
POST/v1/videosSubmit a video generation task

API contract source: docs/openapi/relay.json