Authentication
All API requests require a Bearer token in the Authorization header. You'll receive your API key from the dashboard after signing up.
Authorization: Bearer YOUR_API_KEY
Keep your API key confidential. Do not expose it in client-side code or public repositories.
Chat API
POST /api/v1/chat
Send a message and receive an AI-generated response.
Request Body
{
"model": "anchor-1",
"messages": [
{
"role": "user",
"content": "Explain quantum computing in simple terms"
}
],
"max_tokens": 1024,
"temperature": 0.7
}
Response
{
"id": "anchor-resp-abc123",
"model": "anchor-1",
"choices": [
{
"message": {
"role": "assistant",
"content": "Quantum computing uses..."
}
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 156,
"total_tokens": 168
}
}
cURL Example
curl -X POST https://api.anchoraiworks.com/v1/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"anchor-1","messages":[{"role":"user","content":"Hello"}]}'
Python Example
import requests
response = requests.post(
"https://api.anchoraiworks.com/v1/chat",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"model": "anchor-1",
"messages": [{"role": "user", "content": "Hello"}]
}
)
print(response.json())
JavaScript Example
const response = await fetch('https://api.anchoraiworks.com/v1/chat', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'anchor-1',
messages: [{ role: 'user', content: 'Hello' }]
})
});
const data = await response.json();
Available Models
| Model |
Description |
Context |
Status |
| anchor-1 |
Base model — balanced speed/quality |
8K tokens |
Development |
| anchor-1-turbo |
Optimized for speed |
4K tokens |
Development |
| anchor-1-pro |
Maximum quality, complex reasoning |
16K tokens |
Planned |
Rate Limits
| Plan |
Requests/min |
Tokens/month |
Max tokens/req |
| Starter |
5 |
100K |
2,048 |
| Pro |
30 |
1M |
4,096 |
| Enterprise |
Custom |
Unlimited |
8,192 |
Error Handling
| Code |
Meaning |
Action |
| 400 | Bad Request | Check request body format |
| 401 | Unauthorized | Verify API key |
| 403 | Forbidden | Check plan permissions |
| 429 | Rate Limited | Slow down requests |
| 500 | Server Error | Retry with backoff |
| 503 | Service Unavailable | System maintenance |
Official SDKs
Python
pip install anchorai
Coming Soon
JavaScript
npm install @anchorai/sdk
Coming Soon
PHP
composer require anchorai/sdk
Coming Soon