Skip to main content

Quickstart — API key

Tokligence speaks the API formats your tools already use. The same account and key work across three drop-in compatible surfaces — point any client at the matching endpoint:

FormatEndpointUsed by
OpenAI Chat CompletionsPOST https://llm-api.tokligence.ai/v1/chat/completionsOpenAI SDKs, most apps
OpenAI ResponsesPOST https://llm-api.tokligence.ai/v1/responsesCodex CLI
Anthropic MessagesPOST https://llm-api.tokligence.ai/v1/messagesClaude Code, Anthropic SDKs
Base URL:  https://llm-api.tokligence.ai/v1
Auth: Authorization: Bearer <your-api-key>
  1. Create an account and get an API key from the dashboard.
  2. Set the base URL and key in your client — nothing else changes.

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
api_key="tk-...",
base_url="https://llm-api.tokligence.ai/v1",
)

resp = client.chat.completions.create(
model="deepseek-v4-flash", # see /models for the full list
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

cURL

Every command below is copy-paste ready for your OS and shell. First, save your key to an environment variable so it isn't pasted into each command:

export TOKLIGENCE_API_KEY="tk-..."

Then make your first call. Each tab is wrapped for its shell — select the whole block and paste it. The shells differ only in quoting and how the key variable is referenced.

curl https://llm-api.tokligence.ai/v1/chat/completions \
-H "Authorization: Bearer $TOKLIGENCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Hello!"}]}'

Coding agents (Claude Code, Codex & Cursor)

Because Tokligence serves the native Anthropic Messages and OpenAI Responses formats, coding agents work against it with no proxy or translation layer — just an environment variable or a config file.

Pick a model that speaks the format

The agent endpoints forward your request to the provider that serves the model. Use a model that natively supports the format you're calling — for example deepseek-v4-flash works for both Claude Code (/v1/messages) and Codex (/v1/responses). Browse the catalogue at llm.tokligence.ai/models.

Claude Code

Point Claude Code at Tokligence with three environment variables, then run it as usual:

export ANTHROPIC_BASE_URL="https://llm-api.tokligence.ai"
export ANTHROPIC_AUTH_TOKEN="tk-..." # your Tokligence API key
export ANTHROPIC_MODEL="deepseek-v4-flash" # see /models

claude

To make it stick, add the three export lines to your shell profile (~/.zshrc / ~/.bashrc).

Claude Code sends Anthropic Messages requests to https://llm-api.tokligence.ai/v1/messages, with full tool use and streaming.

Codex

Codex uses the OpenAI Responses API. Add a provider to the Codex config file and select it. The file content is identical on every OS — only its location and how you set the key differ:

model = "deepseek-v4-flash"          # see /models
model_provider = "tokligence"

[model_providers.tokligence]
name = "tokligence"
base_url = "https://llm-api.tokligence.ai/v1"
wire_api = "responses"
env_key = "TOKLIGENCE_API_KEY" # Codex reads the key from this env var

Config file: ~/.codex/config.toml

export TOKLIGENCE_API_KEY="tk-..."   # your Tokligence API key
codex "explain this repository"

Codex sends Responses requests to https://llm-api.tokligence.ai/v1/responses, including streaming and reasoning.

Cursor

Cursor is cross-platform — the same setup works on macOS, Linux, and Windows. In Settings → Models, enable an OpenAI-compatible custom provider and fill in:

  • Base URLhttps://llm-api.tokligence.ai/v1
  • API key — your Tokligence key (tk-...)
  • Model — add a model from the catalogue, e.g. deepseek-v4-flash (see /models)

Cursor then talks to Tokligence over the OpenAI Chat Completions surface.

Discovering models

GET https://llm-api.tokligence.ai/v1/models

Or browse them with live prices at llm.tokligence.ai/models.

No account? Pay per request

Autonomous agents can skip signup and pay per call in USDC via x402.