Documentation
Quick Start
1. Buy $BASEAPI tokens
Purchase tokens on Uniswap (Base network). 3,000 tokens = $1/day API quota.
2. Get your API key
Connect wallet at /dashboard and sign a message to get your API key.
3. Make API calls
Use any OpenAI-compatible client with our base URL.
API Reference
Base URL
https://baseapi.online/api/v1POST
/chat/completionsGenerate chat completions using any supported model.
Headers
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Content-Type: application/json
Request Body
{
"model": "openai/gpt-4o-mini",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"temperature": 0.7,
"max_tokens": 1000,
"stream": false
}Response
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"created": 1234567890,
"model": "openai/gpt-4o-mini",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 10,
"total_tokens": 30
}
}Code Examples
🐍 Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="sk-YOUR_API_KEY",
base_url="https://baseapi.online/api/v1"
)
response = client.chat.completions.create(
model="openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)🟨 JavaScript/Node.js
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-YOUR_API_KEY',
baseURL: 'https://baseapi.online/api/v1',
});
const response = await client.chat.completions.create({
model: 'openai/gpt-4o-mini',
messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);⚡ cURL
curl https://baseapi.online/api/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [{"role": "user", "content": "Hello!"}]
}'Quota System
Your daily API quota is determined by your $BASEAPI token holdings:
- 3,000 tokens = $1/day in API credits
- Quota is calculated in real-time from on-chain balance
- Usage resets daily at 00:00 UTC
- Unused quota does not roll over
💎 Diamond Hands Bonus
- 0-5 min after buy: 0% quota (warmup)
- After 5 min: 10% base quota
- Each hour: +4% additional
- After 24h: 100% full quota
- If you ever sell: capped at 80% max
- After selling: 30 min cooldown (0% quota)
Rate Limits
- No artificial rate limits
- Limited only by your daily quota
- Streaming supported for all models
Error Codes
| Code | Meaning |
|---|---|
401 | Invalid or missing API key |
403 | No token holdings |
429 | Daily quota exceeded |
500 | Server error |