API Documentation
GiveMeSomeTokens provides an OpenAI-compatible API proxy that routes requests to 14 AI providers using your wallet balances. Use any OpenAI SDK — just swap the base URL and use your GMT key.
Quick Start
Get started in 3 steps: connect a provider key, generate a GMT key, and start making API calls.
- 1.Sign up at givemesometokens.dev/login and connect your AI provider key under Dashboard → API Keys.
- 2.Generate a GMT key under Dashboard → Integrations. It starts with
gmt_. - 3.Make API calls using your GMT key:
curl https://givemesometokens.dev/api/v1/chat/completions \
-H "Authorization: Bearer gmt_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Hello!"}]
}'Or use the OpenAI Python SDK:
from openai import OpenAI
client = OpenAI(
api_key="gmt_your_key_here",
base_url="https://givemesometokens.dev/api/v1"
)
response = client.chat.completions.create(
model="claude-sonnet-4-6", # or gpt-4o, gemini-2.5-pro, etc.
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)Authentication
All API requests require a GMT key passed as a Bearer token in the Authorization header.
Authorization: Bearer gmt_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxChat Completions
/api/v1/chat/completionsCreate a chat completion (OpenAI-compatible)
Full OpenAI-compatible endpoint. Supports streaming.
Request body
{
"model": "claude-sonnet-4-6", // Required: model name
"messages": [ // Required: conversation history
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"stream": false, // Optional: enable SSE streaming
"max_tokens": 1024, // Optional
"temperature": 0.7, // Optional (0-2)
"top_p": 1.0 // Optional
}Response
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1718000000,
"model": "claude-sonnet-4-6",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 15,
"completion_tokens": 12,
"total_tokens": 27
}
}Streaming example
stream = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Write a poem"}],
stream=True
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")Models
/api/v1/modelsList all available models
curl https://givemesometokens.dev/api/v1/models \
-H "Authorization: Bearer gmt_your_key_here"Models are routed by prefix:
| Model prefix | Provider | Examples |
|---|---|---|
| claude-* | Anthropic | claude-sonnet-4-6, claude-opus-4-7 |
| gpt-*, o1-*, o4-* | OpenAI | gpt-4o, gpt-4o-mini, o4-mini |
| gemini-* | gemini-2.5-pro, gemini-2.5-flash | |
| llama-*, mixtral-*, gemma* | Groq | llama-3.3-70b-versatile |
| grok-* | xAI | grok-3, grok-3-mini |
| mistral-*, codestral-* | Mistral AI | mistral-large-latest |
| deepseek-* | DeepSeek | deepseek-chat, deepseek-reasoner |
| command-* | Cohere | command-r-plus, command-r |
| sonar-*, llama-*-online | Perplexity | sonar-pro |
| meta-llama/* (together) | Together AI | meta-llama/Llama-3.3-70B-Instruct-Turbo |
| accounts/fireworks/* | Fireworks AI | accounts/fireworks/models/llama-v3p1-70b-instruct |
| llama3.*b | Cerebras | llama3.3-70b, llama3.1-8b |
| jamba-* | AI21 Labs | jamba-1.5-large |
| Everything else | OpenRouter | Any 200+ OpenRouter model |
Providers
14 providers supported. Connect your keys at Dashboard → API Keys.
See all providers for supported models and API details.
Wallet API
/api/walletGet your wallet balances across all providers
curl https://givemesometokens.dev/api/wallet \
-H "Authorization: Bearer gmt_your_key_here"{
"claudeBalance": 50.0,
"openaiBalance": 100.0,
"geminiBalance": 25.0,
"groqBalance": 75.0
// ... all 14 providers
}Support API
Send token support to a creator programmatically.
/api/supportSend tokens to a creator
{
"creatorId": "clxxxxxxxxxxxx",
"provider": "claude",
"amount": 10.0,
"message": "Keep up the great work!",
"isAnonymous": false,
"isPublic": true
}/api/users/:usernameGet a creator's public profile and wallet address
curl https://givemesometokens.dev/api/users/alice{
"id": "clxxxxxxxxxxxx",
"username": "alice",
"name": "Alice",
"bio": "AI developer",
"isCreator": true,
"creatorTier": "Gold"
}GMT Connect OAuth
Allow your app to authenticate users via GiveMeSomeTokens and access their token balances. Requires a Pro plan. Register an OAuth app →
OAuth flow
- 1. Redirect user to the authorization endpoint
- 2. User approves access on GMT
- 3. GMT redirects back with
?code=... - 4. Exchange code for access token
- 5. Use token to call GMT APIs on behalf of the user
/api/oauth/authorizeRedirect user here to begin OAuth flow
https://givemesometokens.dev/api/oauth/authorize
?client_id=your_client_id
&redirect_uri=https://yourapp.com/callback
&response_type=code
&scope=read_balance use_provider
&state=random_state_string
&code_challenge=sha256_of_verifier // PKCE required
&code_challenge_method=S256/api/oauth/tokenExchange authorization code for access token
{
"grant_type": "authorization_code",
"code": "auth_code_from_redirect",
"redirect_uri": "https://yourapp.com/callback",
"client_id": "your_client_id",
"client_secret": "your_client_secret",
"code_verifier": "your_pkce_verifier"
}/api/oauth/userinfoGet authenticated user info (requires token)
Available scopes
read_profileRead user's public profile inforead_balanceRead token wallet balancesuse_providerRoute API calls through user's walletpaymentSend token support on behalf of usersubscriptionManage recurring token subscriptionsError Codes
| HTTP Status | Error | Cause |
|---|---|---|
| 401 | Unauthorized | Missing or invalid GMT key |
| 400 | Missing model | No model specified in request |
| 400 | No provider key | Provider key not connected in your wallet |
| 400 | Insufficient balance | Wallet balance too low for this request |
| 404 | Item not found | Requested resource does not exist |
| 429 | Rate limited | Too many requests — slow down |
| 500 | Provider error | Upstream AI provider returned an error |
All errors return JSON: { "error": "message" }
SDKs & Tools
Since GMT is OpenAI-compatible, any existing OpenAI SDK works out of the box.
from openai import OpenAI
client = OpenAI(
api_key="gmt_...",
base_url="https://givemesometokens.dev/api/v1"
)import OpenAI from "openai";
const client = new OpenAI({
apiKey: "gmt_...",
baseURL: "https://givemesometokens.dev/api/v1"
});# Set in tool settings:
API Base URL: https://givemesometokens.dev/api/v1
API Key: gmt_your_key_herecurl https://givemesometokens.dev/api/v1/chat/completions \
-H "Authorization: Bearer gmt_..." \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o","messages":[...]}'Integration guides
See Integrations in the dashboard for step-by-step setup for Cursor, Cline, Continue, Roo Code, Aider, and more.