For most new integrations, start with Chat Completions on POST /v1/chat/completions.
curl https://api.tokenlab.sh/v1/chat/completions \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.4", "messages": [ {"role": "user", "content": "What is the capital of France?"} ] }'
from openai import OpenAIclient = OpenAI( api_key="sk-your-api-key", base_url="https://api.tokenlab.sh/v1")response = client.chat.completions.create( model="gpt-5.4", messages=[{"role": "user", "content": "What is the capital of France?"}])print(response.choices[0].message.content)
import OpenAI from 'openai';const client = new OpenAI({ apiKey: 'sk-your-api-key', baseURL: 'https://api.tokenlab.sh/v1'});const response = await client.chat.completions.create({ model: 'gpt-5.4', messages: [{ role: 'user', content: 'What is the capital of France?' }],});console.log(response.choices[0].message.content);
Use POST /v1/responses only when you explicitly need Responses-specific behavior. Some Responses-only fields depend on the selected model and routed path.
The included trial credits are for the first small tests. Add credits in Dashboard → Billing only when you are ready for production usage or higher-volume testing.
stream = client.chat.completions.create( model="gpt-5.4", messages=[{"role": "user", "content": "Tell me a short story."}], stream=True)for chunk in stream: delta = chunk.choices[0].delta.content if delta: print(delta, end="")