Compatibility Matrix
SDKs & Libraries
Use TokenLab with the SDK already in your application
Overview
You do not need a TokenLab-specific SDK. Keep the client your application already uses and change its API key and base URL:
- OpenAI SDKs work with Chat Completions and Responses.
- Anthropic SDKs work with Claude Messages.
- Gemini / Google AI SDKs work with Gemini requests.
Open the matching integration page for client configuration and model-specific limits. For a complete first request, use the Quickstart.
Choose an SDK
OpenAI Python
pip install openai
OpenAI Node
npm install openai
OpenAI Go
go get github.com/openai/openai-go/v3
Anthropic SDK
Native Claude Messages API support
OpenAI SDK Example
Use this for Chat Completions or Responses. The selected model must support the API method you call.
from openai import OpenAI
client = OpenAI(
api_key="sk-your-api-key",
base_url="https://api.tokenlab.sh/v1"
)
response = client.responses.create(
model="gpt-5.6-terra",
input="Reply with: Connected to TokenLab."
)
print(response.output_text)OpenAI Go Example
package main
import (
openai "github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("sk-your-api-key"),
option.WithBaseURL("https://api.tokenlab.sh/v1"),
)
_ = client
}Anthropic SDK Example
from anthropic import Anthropic
client = Anthropic(
api_key="sk-your-api-key",
base_url="https://api.tokenlab.sh"
)
message = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}]
)Which SDK should you use?
| Need | SDK |
|---|---|
| Existing OpenAI-compatible client | OpenAI SDK on TokenLab /v1 |
| Chat Completions, Responses, or embeddings | OpenAI SDK |
| Claude Messages fields | Anthropic SDK |
| Gemini contents, files, cache, or tools | Gemini / Google AI SDK |
| LangChain / LlamaIndex / Vercel AI SDK | Use the dedicated integration pages |