TokenLab

Frameworks & Platforms

Portkey Gateway

Connect Portkey Gateway to TokenLab

Overview

Configure TokenLab as a custom OpenAI-compatible host in Portkey. Use Responses only when your Portkey version supports a custom Responses endpoint.

Provider Values

FieldValue
Provideropenai
Custom Hosthttps://api.tokenlab.sh/v1
API keysk-your-tokenlab-key
ModelA current TokenLab model ID

Chat Completions

Use TokenLab for OpenAI-compatible chat requests:

The example requires a running self-hosted Portkey Gateway; replace the gateway URL with your deployment URL. For Portkey Cloud, also send x-portkey-api-key with your Portkey API key. See the Portkey configuration guide.

curl https://your-portkey-gateway.example/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "x-portkey-provider: openai" \
  -H "x-portkey-custom-host: https://api.tokenlab.sh/v1" \
  -H "Authorization: Bearer sk-your-tokenlab-key" \
  -d '{
    "model": "gpt-5.6-luna",
    "messages": [{"role": "user", "content": "Say hello from TokenLab."}]
  }'

Responses

If your Portkey version supports a custom Responses URL, choose a current Responses-capable model from the Models page and use /v1/responses.

Other API Formats

Anthropic Messages and Gemini can be used through Portkey only if your Portkey version supports custom URLs for those formats.

On this page