Quickstart
Get your API key from your project dashboard, then swap your existing base URL and key. No SDK changes needed — TokenFund speaks OpenAI's protocol.
Credentials
Use these values in your OpenAI-compatible client
Base URL
https://tokenfund.dev/api/v1API Key
tf_proj_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxGet your key: Go to Dashboard → open your project → copy the API key from the top card. It starts with tf_proj_.
Roo Code
Roo Code supports custom OpenAI-compatible providers. Set it up once per project or globally.
Open Roo Code settings
Roo-Code: Open Settings.Select "OpenAI Compatible" as provider
Enter your credentials
Fill in the following fields:
Base URL: https://tokenfund.dev/api/v1
API Key: tf_proj_your_key_here
Model: claude-sonnet-4-5Save and start coding
Cline
Cline (formerly Claude Dev) supports custom OpenAI-compatible endpoints.
Open Cline settings
Choose "OpenAI Compatible"
Configure the endpoint
OpenAI API Key: tf_proj_your_key_here
OpenAI Base URL: https://tokenfund.dev/api/v1
Model ID: claude-sonnet-4-5Cursor
Cursor supports custom models via its OpenAI-compatible settings.
Open Cursor settings
⌘ , to open settings, then go to Models.Add a custom model
Enter your credentials
API Key: tf_proj_your_key_here
Base URL: https://tokenfund.dev/api/v1Then add a custom model name matching one from the supported models list below.
Code examples
TokenFund is a drop-in replacement for the OpenAI SDK base URL. No other changes needed.
curl https://tokenfund.dev/api/v1/chat/completions \
-H "Authorization: Bearer tf_proj_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-5",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 256
}'Proxy API
Use the Proxy API to forward requests to provider endpoints (models list, search, generation stats, etc.). For chat completions and messages with wallet billing, use /api/v1/chat/completions. The proxy forwards everything else. Streaming works where the upstream supports it.
Proxy base URL
Base URL for all proxy requests
https://tokenfund.dev/api/proxy/{provider}/{path}Example: https://tokenfund.dev/api/proxy/anthropic/v1/messages
Supported providers
| Provider | Upstream | Example path |
|---|---|---|
| OpenAI | https://api.openai.com | /api/proxy/openai/v1/chat/completions |
| Anthropic | https://api.anthropic.com | /api/proxy/anthropic/v1/messages |
| OpenRouter | https://openrouter.ai | /api/proxy/openrouter/api/v1/chat/completions |
| Exa AI | https://api.exa.ai | /api/proxy/exa/search |
| Fal AI | https://fal.run | /api/proxy/fal/fal-ai/llava/run |
| Fal AI (Queue) | https://queue.fal.run | /api/proxy/fal-queue/fal-ai/llava/run |
Proxy examples
Anthropic Messages API and OpenRouter chat
Anthropic /v1/messages
curl https://tokenfund.dev/api/proxy/anthropic/v1/messages \
-H "Authorization: Bearer tf_proj_your_key" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-4-5","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]}'OpenRouter models list
curl "https://tokenfund.dev/api/proxy/openrouter/api/v1/models" \
-H "Authorization: Bearer tf_proj_your_key"Exa AI search
curl https://tokenfund.dev/api/proxy/exa/search \
-H "Authorization: Bearer tf_proj_your_key" \
-H "Content-Type: application/json" \
-d '{"query":"machine learning","numResults":5}'Set the provider's API key in your environment (e.g. ANTHROPIC_API_KEY, OPENROUTER_API_KEY, EXA_API_KEY, FAL_KEY) for platform billing. For hackathons, organizer keys are used when configured.
Supported models
Pass the model name in the model field. Anthropic models are converted from OpenAI format automatically.
Anthropic (Claude)
| Model | Input / 1M | Output / 1M | Note |
|---|---|---|---|
| claude-opus-4-6 | $5.00 | $25.00 | Most intelligent |
| claude-sonnet-4-5 | $3.00 | $15.00 | Recommended for coding tools |
| claude-haiku-4-5 | $1.00 | $5.00 | Fast & affordable |
| claude-3-haiku-20240307 | $0.25 | $1.25 | Cheapest (legacy) |
OpenAI
| Model | Input / 1M | Output / 1M | Note |
|---|---|---|---|
| gpt-5 | $1.25 | $10.00 | Most capable |
| gpt-4.1 | $2.00 | $8.00 | Great for coding |
| gpt-4.1-mini | $0.40 | $1.60 | Fast & cheap |
| gpt-4o-mini | $0.15 | $0.60 | Cheapest |
Prices per 1M tokens. Older versioned model IDs (e.g. claude-sonnet-4-5-20250929) are also supported.
Error reference
| Code | Name | Description |
|---|---|---|
| 401 | AUTH_ERROR | Missing or invalid API key. Check that your key starts with tf_proj_ and has no extra spaces. |
| 402 | INSUFFICIENT_BALANCE | Project wallet is empty. Share your donation page to get more credits. |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests. Default limit is 10 requests/minute per project. |
| 400 | VALIDATION_ERROR | Missing or invalid request fields (e.g. no model specified). |
| 502 | PROVIDER_ERROR | Upstream error from Anthropic or OpenAI. Retry the request. |