Docs · Quickstart

First request
in five steps.

TokenHaven speaks the OpenAI API format, so any OpenAI SDK or tool works with it. Change the base URL and the key; keep the rest of your code.

Base URL
https://api.tokenhaven.ai/v1
Auth header
Authorization: Bearer <key>
Key prefix
sk-th-v1-
Format
OpenAI chat completions

01

Create an account and an API key

Sign up, add some credit, then open API keys and create a key. Copy it straight away: it starts with sk-th-v1- and is shown only once.

Keep it out of your code. Store it in an environment variable:

export TOKENHAVEN_API_KEY="sk-th-v1-..."

02

Point your client at TokenHaven

Use this base URL, and send your key as a bearer token in the Authorization header:

https://api.tokenhaven.ai/v1

03

Make a request

Pick your language. The highlighted lines are the only ones that differ from a plain OpenAI setup.

from openai import OpenAI
client = OpenAI(
base_url="https://api.tokenhaven.ai/v1",
api_key="sk-th-v1-...",
)
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-4.5",
messages=[{"role": "user", "content": "Hello from Lagos!"}],
)
print(reply.choices[0].message.content)

Already using the OpenAI SDK? Change the two highlighted lines. That’s it.

04

Pick a model

Set the model field to any id from the model catalogue, for example openai/gpt-4o-mini, anthropic/claude-sonnet-4.5 or deepseek/deepseek-chat. Switching models is a one-word change.

05

Watch your usage

Every request shows up in your dashboard under Activity, and on the page of the key that made it, with tokens and cost. If a key leaks or an app misbehaves, disable or delete the key and requests with it stop immediately.

Questions or need a hand?

Email hello@tokenhaven.ai.

Browse models