Use the OpenAI-compatible base URL with a Tokenless API key:
https://api.usetokenless.com/openai/v1
Tokenless preserves the OpenAI request and response formats for the routes
below, while choosing the upstream model behind a routing mode such as
tokenless-pro.
Use an OpenAI client
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.usetokenless.com/openai/v1",
api_key=os.environ["TOKENLESS_API_KEY"],
)
response = client.chat.completions.create(
model="tokenless-pro",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.usetokenless.com/openai/v1",
apiKey: process.env.TOKENLESS_API_KEY,
});
const response = await client.chat.completions.create({
model: "tokenless-pro",
messages: [{ role: "user", content: "Hello" }],
});
console.log(response.choices[0]?.message.content);
curl https://api.usetokenless.com/openai/v1/chat/completions \
-H "Authorization: Bearer $TOKENLESS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tokenless-pro",
"messages": [{"role": "user", "content": "Hello"}]
}'
Use Codex with tkl
With the Tokenless CLI installed, sign in once and launch Codex through the
OpenAI-compatible route. No API key setup is required.
For the full upstream specification, see the OpenAI API
reference. Use these
pages for the Tokenless-compatible routes and routing behavior.