API Documentation
Integrate Devs AIO's AI capabilities into your applications. Our API follows the OpenAI-compatible format, meaning you can use any OpenAI SDK by simply changing the base URL and API key.
API access is available for Pro, Team, Ultra, and Custom plan users only. Free plan users can explore the documentation but cannot generate API keys or make API calls.
Get StartedDevs AIO provides access to state-of-the-art AI models including DEVSAIO-CHAT-V1, DEVSAIO-IMG-V1, and DEVSAIO-VID-V1. Built and hosted in Pakistan, we offer the most competitive pricing for enterprise-grade AI.
- ✓ Text chat with streaming support
- ✓ Image generation (DALL-E, Stable Diffusion)
- ✓ Video generation
- ✓ Multiple model selection
- ✓ Usage tracking and analytics
Authentication
All API requests require authentication via API key in the Authorization header.
API keys follow the format sk-aio-{32 hex characters}.
Generate your keys from the Developer Dashboard.
// Include in every API request Authorization: Bearer sk-aio-4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c
- 1. Never expose your API key in client-side code or public repositories
- 2. Rotate keys regularly using the revoke/delete functionality
- 3. Set spend limits on each key to control costs
- 4. Use separate keys for development and production environments
Each API key can be independently managed. You can revoke, delete, or create new keys at any time from your Developer Dashboard. Revoked keys stop working immediately. Deleted keys cannot be recovered.
Quick Start
Get up and running with the Devs AIO API in 3 simple steps.
Subscribe to a Pro, Team, Ultra, or Custom plan, then generate an API key from the Developer Dashboard.
curl https://devsaio.lol/api/v1/chat \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "devsaio-chat-v1", "messages": [ {"role": "user", "content": "Hello!"} ] }'
{
"id": "aio_xxxxxxxxxxxxx",
"object": "chat.completion",
"model": "devsaio-chat-v1",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "Hello! How can I help you?"},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 9,
"total_tokens": 21
}
}
POST /api/v1/chat
Send a chat message and receive an AI-generated response.
| Name | Type | Description |
|---|---|---|
Authorization | string | Bearer token with your API key |
Content-Type | string | Must be application/json |
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID (e.g., devsaio-chat-v1) |
messages | array | Yes | Array of message objects with role and content |
max_tokens | integer | Optional | Maximum tokens in response (default: 4096) |
stream | boolean | Optional | Enable streaming responses (default: false) |
temperature | float | Optional | Creativity level 0.0-2.0 (default: 0.7) |
{
"model": "devsaio-chat-v1",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is AI?"}
],
"max_tokens": 1024,
"stream": false
}
{
"id": "aio_8f3a2b1c0d9e",
"object": "chat.completion",
"created": 1720000000,
"model": "devsaio-chat-v1",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "AI stands for Artificial Intelligence..."},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 180,
"total_tokens": 205
}
}
POST /api/v1/image
Generate images using AI models like DALL-E and Stable Diffusion.
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text description of the image to generate |
model | string | Optional | Image model (default: dall-e-3) |
size | string | Optional | Image size: 1024x1024, 1024x1792, 1792x1024 |
quality | string | Optional | standard or hd |
n | integer | Optional | Number of images (1-4, default: 1) |
{
"prompt": "A futuristic city at sunset, cyberpunk style",
"model": "dall-e-3",
"size": "1024x1024",
"quality": "hd"
}
POST /api/v1/video
Generate short video clips from text descriptions.
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text description of the video to generate |
duration | integer | Optional | Duration in seconds (default: 4) |
resolution | string | Optional | Video resolution (default: 720p) |
{
"prompt": "A serene mountain lake at dawn with mist rising",
"duration": 5,
"resolution": "1080p"
}
GET /api/v1/models
List all available AI models and their capabilities.
| Name | Type | Description |
|---|---|---|
Authorization | string | Bearer token with your API key |
{
"data": [
{
"id": "devsaio-chat-v1",
"object": "model",
"created": 1720000000,
"owned_by": "anthropic",
"type": "chat"
},
{
"id": "devsaio-chat-v1-thinking",
"object": "model",
"created": 1720000000,
"owned_by": "anthropic",
"type": "chat"
},
{
"id": "devsaio-chat-v1",
"object": "model",
"created": 1720000000,
"owned_by": "google",
"type": "chat"
},
{
"id": "dall-e-3",
"object": "model",
"type": "image"
}
]
}
GET /api/v1/usage
Check your current API usage statistics, quotas, and consumption.
| Parameter | Type | Description |
|---|---|---|
period | string | daily, monthly, or all_time (default: daily) |
{
"period": "daily",
"requests": 42,
"tokens_used": 15840,
"spend": 0.032,
"limits": {
"daily_requests": 1000,
"monthly_requests": 30000,
"rpm": 60
},
"reset_at": "2025-07-16T00:00:00Z"
}
POST /api/v1/auth/refresh
Refresh your API session or regenerate an API key.
| Field | Type | Required | Description |
|---|---|---|---|
key_id | integer | Yes | ID of the API key to refresh |
new_name | string | Optional | New name for the key |
{
"success": true,
"new_api_key": "sk-aio-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"message": "Key regenerated. Save this key - it won't be shown again."
}
Quota & Balance API
Check your remaining tokens, usage limits, and plan details programmatically.
| Name | Type | Description |
|---|---|---|
Authorization | string | Bearer token with your API key |
{
"plan": "pro",
"plan_name": "Pro Plan",
"tokens_remaining">: 485200,
"tokens_total": 500000,
"tokens_used": 14800,
"usage_percent": 2.96,
"daily_requests": 12,
"daily_limit": 1000,
"monthly_requests">: 340,
"monthly_limit": 30000,
"plan_expires_at">: "2026-08-16T00:00:00Z",
"overage_allowed">: false
}
| Parameter | Type | Description |
|---|---|---|
period | string | daily, weekly, monthly, or all_time (default: monthly) |
{
"period": "monthly",
"requests": 340,
"tokens_used": 15840,
"cost_usd": 0.032,
"limits": {
"monthly_requests">: 30000,
"monthly_tokens": 500000,
"rpm": 60
},
"reset_at": "2026-08-01T00:00:00Z"
}
Error Codes
HTTP status codes and error responses you may encounter.
| Code | Meaning | Description |
|---|---|---|
200 | OK | Request succeeded |
400 | Bad Request | Invalid request body or missing required fields |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | Account suspended or insufficient permissions |
404 | Not Found | Endpoint does not exist |
429 | Too Many Requests | Rate limit exceeded. Wait and retry. |
500 | Server Error | Internal server error. Contact support. |
502 | Bad Gateway | Upstream AI provider returned an error |
503 | Service Unavailable | Maintenance or provider temporarily unavailable |
{
"error": {
"code": "rate_limit_exceeded",
"message": "You have exceeded your rate limit. Please wait before making another request.",
"retry_after": 30
}
}
Rate Limits
API rate limits vary by subscription plan. Exceeding limits returns a 429 status code.
// Rate limit headers included in every response X-RateLimit-Limit: 60 // Max requests per minute X-RateLimit-Remaining: 59 // Requests remaining in window X-RateLimit-Reset: 1720000060 // Unix timestamp when limit resets Retry-After: 12 // Seconds to wait (only on 429)
| Plan | Requests/Min | Requests/Day | Requests/Month |
|---|---|---|---|
| Pro | 60 | 1,000 | 30,000 |
| Team | 120 | 5,000 | 100,000 |
| Ultra | 300 | Unlimited | Unlimited |
| Custom | Custom | Custom | Custom |
| Admin | Unlimited | Unlimited | Unlimited |
-
1.
Implement exponential backoff when you receive a
429response -
2.
Check the
Retry-Afterheader to know how long to wait -
3.
Monitor your usage via the
GET /api/v1/usageendpoint - 4. Consider upgrading your plan for higher limits
SDKs & Libraries
Our API is OpenAI-compatible, so you can use any OpenAI SDK with minimal changes.
from openai import OpenAI client = OpenAI( api_key="sk-aio-YOUR_KEY", base_url="https://devsaio.lol/api/v1" ) response = client.chat.completions.create( model="devsaio-chat-v1", messages=[{"role": "user", "content": "Hello!"}], ) print(response.choices[0].message.content)
import OpenAI from 'openai'; const client = new OpenAI({ apiKey: 'sk-aio-YOUR_KEY', baseURL: 'https://devsaio.lol/api/v1', }); const response = await client.chat.completions.create({ model: 'devsaio-chat-v1', messages: [{ role: 'user', content: 'Hello!' }], }); console.log(response.choices[0].message.content);
curl https://devsaio.lol/api/v1/chat \ -H "Authorization: Bearer sk-aio-YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"devsaio-chat-v1","messages":[{"role":"user","content":"Hello!"}]}'
Contact Us
Need help or have questions? Reach out to us.
Payment Guide
Learn how to subscribe to Devs AIO. We support local payments for Pakistan and global crypto payments for everyone else.
-
1
Choose your planBrowse plans at /pricing and select Pro, Team, or Ultra.
-
2
Select payment methodPakistan users: EasyPaisa or JazzCash. Global users: Binance Pay (USDT/LTC/Pay ID).
-
3
Send paymentUse the displayed account/address. Copy with one click. Upload a screenshot if available.
-
4
Enter transaction IDPaste your transaction/reference ID and submit the form.
-
5
VerificationCrypto payments verified in 10-20 minutes. Local transfers within 24 hours. Get WhatsApp support at +92 344 2637285.
| Plan | PKR | USD | Per Month |
|---|---|---|---|
| Pro | PKR 2,499 | $9 | PKR 2,499 / $9 |
| Team | PKR 5,999 | $22 | PKR 5,999 / $22 |
| Ultra | PKR 11,999 | $45 | PKR 11,999 / $45 |
Discounts: 10% off for 3 months, 20% off for annual plans.
DEVSAIO API
Integrate DEVSAIO models into your applications. Our API follows the OpenAI-compatible format, so you can use any OpenAI SDK by simply changing the base URL and API key.
https://devsaio.lol/api/v1Authentication: Bearer token via
Authorization: Bearer YOUR_API_KEY
Send a message and receive a text response. Uses the devsaio-chat-v1 model.
curl https://devsaio.lol/api/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "devsaio-chat-v1", "messages": [{"role": "user", "content": "Hello, who are you?"}] }'
Enable "stream": true to receive tokens as they are generated, providing a real-time typing experience.
curl https://devsaio.lol/api/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "devsaio-chat-v1", "messages": [{"role": "user", "content": "Say hello"}], "stream": true }'
Define custom functions and let the model decide when and how to call them. The model returns a tool call instead of a direct text response.
curl https://devsaio.lol/api/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "devsaio-chat-v1", "messages": [{"role": "user", "content": "What is 2+2?"}], "tools": [{ "type": "function", "function": { "name": "calculate", "parameters": { "type": "object", "properties": { "expression": {"type": "string"} }, "required": ["expression"] } } }] }'
Send images alongside text for visual analysis. The model can describe, extract text, or reason about image content.
curl https://devsaio.lol/api/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "devsaio-chat-v1", "messages": [{ "role": "user", "content": [ {"type": "text", "text": "Describe this image."}, {"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}} ] }] }'
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | devsaio-chat-v1 |
messages | array | Yes | Array of message objects with role (user, assistant, system) and content |
stream | boolean | Optional | Enable streaming responses (default: false) |
temperature | float | Optional | Creativity level 0.0–2.0 (default: 0.7) |
max_tokens | integer | Optional | Maximum tokens in response (default: 4096) |
tools | array | Optional | Tool/function definitions for function calling |
Generate images from text descriptions using devsaio-img-v1.
curl https://devsaio.lol/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "devsaio-img-v1", "prompt": "A futuristic cyberpunk city at night", "size": "1024x1024" }'
Modify existing images by providing a source image along with an edit prompt.
curl https://devsaio.lol/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "devsaio-img-v1", "prompt": "Make the object blue", "extra_body": {"image": ["https://example.com/input.png"]} }'
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | devsaio-img-v1 |
prompt | string | Yes | Text description of the image to generate |
size | string | Optional | Image dimensions, e.g. 1024x1024 |
image | string[] | Optional | Source image URLs for image-to-image editing |
Generate short video clips from text descriptions. Video generation is currently in beta.
curl https://devsaio.lol/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "devsaio-vid-v1", "prompt": "A serene mountain lake at dawn with mist rising", "duration": 5, "resolution": "1080p" }'
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | devsaio-vid-v1 |
prompt | string | Yes | Text description of the video to generate |
duration | integer | Optional | Duration in seconds (default: 4) |
resolution | string | Optional | Video resolution (default: 720p) |