Overview

The Token360 API supports OpenAI-compatible, Anthropic Messages, and Gemini-native request and response formats, and follows RESTful conventions.

Base URL

For OpenAI-compatible clients:

text
1https://api.token360.ai/v1

For the Google Gen AI SDK, use https://api.token360.ai as the base URL and API version v1. Native Gemini generation endpoints start with /v1/models/; /v1beta/models/ remains supported for existing clients. See Generate Gemini content for SDK configuration and examples.

Authentication

OpenAI-compatible requests require a Token360 API key in the Authorization header:

Authorization: Bearer sk-your-api-key

Gemini-native requests use x-goog-api-key: sk-your-api-key. Anthropic Messages also accepts x-api-key: sk-your-api-key. Use your Token360 API key for each protocol.

Request Format

  • Content-Type: application/json for most endpoints. multipart/form-data for file uploads.
  • Method: POST for inference and creation, GET for retrieval, DELETE for deletion.

Example Request

Shell
1curl -X POST https://api.token360.ai/v1/chat/completions \
2  -H "Authorization: Bearer sk-your-api-key" \
3  -H "Content-Type: application/json" \
4  -d '{
5    "model": "claude-opus-5",
6    "messages": [{"role": "user", "content": "Hello"}]
7  }'

Response Format

Successful responses return JSON with endpoint-specific data:

JSON
1{
2  "id": "your-chat-completion-id",
3  "object": "chat.completion",
4  "created": 1677652288,
5  "model": "claude-opus-5",
6  "choices": [...],
7  "usage": {
8    "prompt_tokens": 10,
9    "completion_tokens": 20,
10    "total_tokens": 30
11  }
12}

Error responses follow a consistent format:

JSON
1{
2  "code": "400",
3  "error": {
4    "message": "Description of the error",
5    "type": "error_type",
6    "param": null,
7    "code": "error_code",
8    "traceId": "request-correlation-id"
9  },
10  "traceId": "request-correlation-id"
11}

Use the HTTP status as the primary failure signal. See Error Handling for field definitions and retry guidance.

SDK Support

Token360 is compatible with the official OpenAI SDKs:

1# Python
2from openai import OpenAI
3client = OpenAI(api_key="sk-...", base_url="https://api.token360.ai/v1")

Clients that support a custom OpenAI base URL can use the OpenAI-compatible endpoints. For Gemini-native requests, use the Google Gen AI SDK configuration with base URL https://api.token360.ai and explicit API version v1.

Native LLM endpoints

Token360 supports four LLM request styles, subject to model support:

  • POST /v1/chat/completions — OpenAI-compatible chat completions, including streaming for supported models.
  • POST /v1/responses — OpenAI Responses-compatible requests and responses. Use previous_response_id and store for supported follow-up requests. conversation and background: true are not currently supported.
  • POST /v1/messages — Anthropic Messages-compatible requests and responses. Supports Authorization: Bearer sk-... and Anthropic-style x-api-key: sk-... platform authentication.
  • POST /v1/models/{model}:generateContent and POST /v1/models/{model}:streamGenerateContent?alt=sse — Gemini-native requests using contents, with candidates and usageMetadata in responses. Authenticate with x-goog-api-key: sk-.... See Generate Gemini content.

Use the response fields and streaming events documented for your selected endpoint. Check model-specific capabilities before sending optional parameters.

Async chat

POST /v1/async/chat/completions queues a single non-streaming chat job (stream must be false). Poll GET /v1/async/chat/completions/{job_id} until completed / failed / cancelled / expired. Cancel a non-terminal job with POST /v1/async/chat/completions/{job_id}/cancel. Billing matches synchronous chat (including enterprise price factor); reconcile with GET /v1/billing/requests/{request_id}.

Batch jobs

Token360 exposes an OpenAI-compatible Batch API for asynchronous chat completions:

  • GET /v1/batches/models — models available for batch requests on your account
  • POST /v1/files (purpose=batch) + POST /v1/batches — submit a JSONL input file; optional execution: auto (default) / provider / platform
  • GET /v1/batches/{batch_id} — poll status; download results via GET /v1/files/{file_id}/content
  • Optional callback_url on create (or console Batch jobs → Webhook) — HTTPS POST on terminal state; see Webhook

See Docs → Batch Jobs and the API Reference → Batches section. Use the OpenAI SDK with base_url=https://api.token360.ai/v1 and client.batches.* / client.files.create(..., purpose="batch").

Model pricing

GET /v1/models/{model_id}/pricing returns what the authenticated account pays for one model. Use the first matching rule. When price_factor is present, pay rate × price_factor; otherwise pay rate. See Get model pricing.

Billing and account balance

  • GET /v1/billing/requests/{request_id} — usage and charges for one call, using a request ID or a supported response, message, or generation task/media ID, including IDs containing slashes
  • GET /v1/billing/balance — current spendable balance (wallet + credit) for the authenticated account

See API Reference → Billing → Get Request Usage for supported IDs, examples, and lookup errors, and Get Account Balance for balances.

API key management

Token360 provides OpenRouter-compatible API key management endpoints on /v1:

  • GET /v1/key — inspect the API key used by the current request
  • GET /v1/keys — list your API keys
  • POST /v1/keys — create a new API key
  • PATCH /v1/keys/{hash} — update an API key by hash
  • DELETE /v1/keys/{hash} — delete an API key by hash

See API Reference → API Keys for request fields and response examples.

Native request bodies (Token360-Native-Params)

For POST /v1/videos, POST /v1/images/generations, and POST /v1/audio/speech, models that document a native request format accept that JSON body when you set:

Token360-Native-Params: true

Use your Token360 API key and the public model name. Follow the selected model's request documentation when using this header.

Was this page helpful?
Overview · Token360