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 Restricted

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 Started
Platform Overview

Devs 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.

Models
DEVSAIO Suite
Format
OpenAI-Compatible
Base URL
https://devsaio.lol
Supported Features
  • 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 Key Format

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
Security Best Practices
  • 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
Key Management

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.

Step 1: Get Your API Key

Subscribe to a Pro, Team, Ultra, or Custom plan, then generate an API key from the Developer Dashboard.

Step 2: Make Your First Request
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!"}
    ]
  }'
Step 3: Parse the Response
{
  "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.

POST
https://devsaio.lol/api/v1/chat
Headers
NameTypeDescription
AuthorizationstringBearer token with your API key
Content-TypestringMust be application/json
Request Body
FieldTypeRequiredDescription
modelstringYesModel ID (e.g., devsaio-chat-v1)
messagesarrayYesArray of message objects with role and content
max_tokensintegerOptionalMaximum tokens in response (default: 4096)
streambooleanOptionalEnable streaming responses (default: false)
temperaturefloatOptionalCreativity level 0.0-2.0 (default: 0.7)
Example Request
{
  "model":     "devsaio-chat-v1",
  "messages": [
    {"role": "system",  "content": "You are a helpful assistant."},
    {"role": "user",    "content": "What is AI?"}
  ],
  "max_tokens": 1024,
  "stream":     false
}
Response
{
  "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.

POST
https://devsaio.lol/api/v1/image
Request Body
FieldTypeRequiredDescription
promptstringYesText description of the image to generate
modelstringOptionalImage model (default: dall-e-3)
sizestringOptionalImage size: 1024x1024, 1024x1792, 1792x1024
qualitystringOptionalstandard or hd
nintegerOptionalNumber of images (1-4, default: 1)
Example
{
  "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.

POST
https://devsaio.lol/api/v1/video
Request Body
FieldTypeRequiredDescription
promptstringYesText description of the video to generate
durationintegerOptionalDuration in seconds (default: 4)
resolutionstringOptionalVideo resolution (default: 720p)
Example
{
  "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.

GET
https://devsaio.lol/api/v1/models
Headers
NameTypeDescription
AuthorizationstringBearer token with your API key
Response
{
  "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.

GET
https://devsaio.lol/api/v1/usage
Query Parameters
ParameterTypeDescription
periodstringdaily, monthly, or all_time (default: daily)
Response
{
  "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.

POST
https://devsaio.lol/api/v1/auth/refresh
Request Body
FieldTypeRequiredDescription
key_idintegerYesID of the API key to refresh
new_namestringOptionalNew name for the key
Response
{
  "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.

GET
https://devsaio.lol/api/v1/quota
Headers
NameTypeDescription
AuthorizationstringBearer token with your API key
Example Response
{
  "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
}
GET
https://devsaio.lol/api/v1/usage
Query Parameters
ParameterTypeDescription
periodstringdaily, weekly, monthly, or all_time (default: monthly)
Example Response
{
  "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.

HTTP Status Codes
CodeMeaningDescription
200OKRequest succeeded
400Bad RequestInvalid request body or missing required fields
401UnauthorizedMissing or invalid API key
403ForbiddenAccount suspended or insufficient permissions
404Not FoundEndpoint does not exist
429Too Many RequestsRate limit exceeded. Wait and retry.
500Server ErrorInternal server error. Contact support.
502Bad GatewayUpstream AI provider returned an error
503Service UnavailableMaintenance or provider temporarily unavailable
Error Response Format
{
  "error": {
    "code":    "rate_limit_exceeded",
    "message": "You have exceeded your rate limit. Please wait before making another request.",
    "retry_after": 30
  }
}
Common Error Codes
invalid_api_key The API key is invalid or has been revoked
rate_limit_exceeded Too many requests. Check your plan limits
daily_limit_reached Daily request limit exceeded. Resets at midnight UTC
insufficient_funds Spend limit reached for this billing period
model_not_found The specified model ID does not exist
upstream_error The AI provider returned an error. Try again later

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)
Limits by Plan
PlanRequests/MinRequests/DayRequests/Month
Pro601,00030,000
Team1205,000100,000
Ultra300UnlimitedUnlimited
CustomCustomCustomCustom
AdminUnlimitedUnlimitedUnlimited
Handling Rate Limits
  1. 1. Implement exponential backoff when you receive a 429 response
  2. 2. Check the Retry-After header to know how long to wait
  3. 3. Monitor your usage via the GET /api/v1/usage endpoint
  4. 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.

Python (openai package)
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)
JavaScript / Node.js
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 (no SDK needed)
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.

Accepted Payment Methods
🇵🇰 Pakistan — Local Methods
📱
EasyPaisa
Send PKR directly to our EasyPaisa number. Account name and number shown on payment page.
📲
JazzCash
Send PKR directly to our JazzCash number. Account name and number shown on payment page.
🌍 Global — Binance Pay & Crypto
🟡
USDT (TRC-20)
Send USDT on the Tron network. Wallet address shown on payment page with copy-to-clipboard.
🔷
Litecoin (LTC)
Send LTC to our wallet address. Low fees, fast confirmation.
💳
Binance Pay ID
Pay instantly using your Binance Pay ID. Scan QR code in the Binance app. Fastest option.
How Payment Works
  1. 1
    Choose your plan
    Browse plans at /pricing and select Pro, Team, or Ultra.
  2. 2
    Select payment method
    Pakistan users: EasyPaisa or JazzCash. Global users: Binance Pay (USDT/LTC/Pay ID).
  3. 3
    Send payment
    Use the displayed account/address. Copy with one click. Upload a screenshot if available.
  4. 4
    Enter transaction ID
    Paste your transaction/reference ID and submit the form.
  5. 5
    Verification
    Crypto payments verified in 10-20 minutes. Local transfers within 24 hours. Get WhatsApp support at +92 344 2637285.
Pricing (Dual Currency Display)
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.

🔑
Base URL: https://devsaio.lol/api/v1
Authentication: Bearer token via Authorization: Bearer YOUR_API_KEY
💬
Chat Completions
Text chat with streaming, tool calling, and image understanding capabilities.
🎨
Image Generation
Text-to-image and image-to-image generation with customizable sizes.
🔧
Function Calling
Define custom tools and let the model decide when and how to use them.
📸
Vision
Multi-modal inputs — send images alongside text for visual understanding.
Basic Chat Completion

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?"}]
  }'
Streaming Responses

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
  }'
Tool Calling (Function Calling)

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"]
        }
      }
    }]
  }'
Image Understanding (Vision)

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"}}
      ]
    }]
  }'
Chat Parameters Reference
FieldTypeRequiredDescription
modelstringYesdevsaio-chat-v1
messagesarrayYesArray of message objects with role (user, assistant, system) and content
streambooleanOptionalEnable streaming responses (default: false)
temperaturefloatOptionalCreativity level 0.0–2.0 (default: 0.7)
max_tokensintegerOptionalMaximum tokens in response (default: 4096)
toolsarrayOptionalTool/function definitions for function calling
Text-to-Image Generation

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"
  }'
Image-to-Image Generation

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"]}
  }'
Image Parameters Reference
FieldTypeRequiredDescription
modelstringYesdevsaio-img-v1
promptstringYesText description of the image to generate
sizestringOptionalImage dimensions, e.g. 1024x1024
imagestring[]OptionalSource image URLs for image-to-image editing
Video Generation

Generate short video clips from text descriptions. Video generation is currently in beta.

🚧
Video generation endpoints are currently in beta. Contact us for early access and rate limit details.
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"
  }'
Video Parameters Reference
FieldTypeRequiredDescription
modelstringYesdevsaio-vid-v1
promptstringYesText description of the video to generate
durationintegerOptionalDuration in seconds (default: 4)
resolutionstringOptionalVideo resolution (default: 720p)