Introduction
Welcome to the Zylo API documentation. Our unified API provides access to multiple AI models including GPT, Claude, Gemini, and more through a single, consistent interface.
Key features:
- OpenAI-compatible endpoints for easy migration
- Support for text generation, chat completions, and image generation
- Function calling and tool use (Gemini models)
- Web search and URL context grounding
- Multiple pricing tiers to fit your needs
Base URL
All API requests should be prefixed with this base URL:
https://api.zyloai.net
Authorization
Authenticate using your API Key. You can send it in two ways:
Method 1: Authorization Header (Recommended)
Method 2: Request Body Parameter
Endpoints
/generate
Primary unified generation endpoint for text and code.
/chat/completions
OpenAI-compatible chat completions endpoint.
/stats
Retrieve current usage and limits.
/health
Check API service status.
/validate
NEWValidate your API key and check current limits before making requests. Returns detailed information about your plan, usage, and remaining quota.
curl -H "X-API-Key: YOUR_KEY" \
https://api.zyloai.net/validate
{
"valid": true,
"plan": "BASIC",
"planLabel": "Free Tier",
"limits": {
"tokens": {
"used": 1024,
"limit": 4096,
"remaining": 3072
},
"requests": {
"used": 50,
"limit": 1000
}
},
"canMakeRequest": true,
"allowedModels": ["openai", "gemini-3"]
}
Tools
Enable models to interact with external services and execute code.
Function Calling
All PlansDefine functions in your request and let the model generate JSON arguments. Perfect for integrating with external APIs.
{
"model": "gemini-3",
"messages": [{"role": "user", "content": "What's the weather in Tokyo?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a city",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string"}
}
}
}
}]
}
Google Search & URL Context
Gemini Only Pro+Ground responses in real-time web data or specific URLs for up-to-date information.
{
"model": "gemini-3",
"messages": [{"role": "user", "content": "Latest news about AI"}],
"tools": [{"googleSearch": {}}]
}
Code Execution
Gemini Only EnterpriseExecute Python code in a sandboxed environment for complex calculations and data processing.
{
"model": "gemini-3-pro",
"messages": [{"role": "user", "content": "Calculate the 50th fibonacci number"}],
"tools": [{"codeExecution": {}}]
}
Feature Matrix
Comprehensive model capabilities and enterprise tooling comparison.
| Capability | Basic | Pro | Mega | Enterprise |
|---|---|---|---|---|
| Vision & Image Input | ✓ | ✓ | ✓ | ✓ |
| Streaming Responses | ✓ | ✓ | ✓ | ✓ |
| Tools & Function Calling | ✓ | ✓ | ✓ | ✓ |
| Google Search Access | — | ✓ | ✓ | ✓ |
| Code Execution (Sandboxed) | LIMITED | STANDARD | HIGH SPEED | ✓ |
| Long Context (2M+) | — | — | ✓ | ✓ |
| Priority Support | — | DISCORD |
|
Model Collection
Wide range of specialized AI models.
| Model Name | Model ID | Plan |
|---|---|---|
|
|
openai
|
Free Tier |
|
|
gemini-3
|
Free Tier |
|
|
gemini-2.5
|
Free Tier |
|
|
grok
|
Pro |
|
|
minimax
|
Pro |
|
|
deepseek-v3.2
|
Mega |
|
|
gpt-5.2
|
Enterprise |
|
|
gemini-3-pro
|
Enterprise |
|
|
opus-4.5
|
Enterprise |
|
|
haiku-4.5
|
Enterprise |
| Claude Opus 4.5 Reasoning | opus-4.5-reasoning
|
Enterprise |
Implementation Examples
import requests
url = "https://api.zyloai.net/chat/completions"
payload = {
"model": "gemini-3",
"system_prompt": "You are a helpful assistant.",
"messages": [
{"role": "user", "content": "Hello! How can you help me today?"}
]
}
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
async function run() {
const response = await fetch('https://api.zyloai.net/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gemini-3-pro',
messages: [{ role: 'user', content: 'What is the current Bitcoin price?' }],
web_search: true
})
});
console.log(await response.json());
}
curl https://api.zyloai.net/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3",
"messages": [{"role": "user", "content": "Hello world"}]
}'
Parameters
Configuration options for Chat Completions API.
model
string
ID of the model to use. See .
messages
array
List of message objects enclosed in
brackets. Example: [{role: "user", content: "Hi"}].
temperature
float
Sampling temperature (0.0 to 1.0). Higher values = more creative, lower values = more deterministic.
system_prompt
string
Global instructions for the model. This is an alternative to providing a 'system' role message.
tools
array
List of function definitions for the model to call. See .
stream
boolean
If set, tokens will be sent as data-only server-sent events as they become available.
image
string
URL or Data URI of an image for visual input models.
Response Format
All API responses follow the OpenAI-compatible format.
Success Response (200)
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1705891234,
"model": "gemini-3",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm doing great, thank you for asking."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 12,
"total_tokens": 37
}
}
Function Call Response
{
"choices": [{
"message": {
"role": "assistant",
"content": null,
"tool_calls": [{
"id": "call_abc123",
"type": "function",
"function": {
"name": "get_weather",
"arguments": "{\"city\": \"Tokyo\"}"
}
}]
},
"finish_reason": "tool_calls"
}]
}
Error Handling
Standardized error responses for easy debugging.
The request body or parameters are invalid. Check your JSON formatting and required fields.
Invalid or missing API key. Ensure you are sending the correct key in the Authorization header.
You have exceeded your plan's rate limits. Please slow down your requests or upgrade your plan.
Internal server error. This is likely an issue on our end. Please try again later.
Error Structure
JSONRate Limits
Request quotas and throughput limits by plan
Basic
FREEPro
$50/moMega
$175/moEnterprise
$355/moRate Limit Headers
Monitor your usage in real-time via response headers:
429 Too Many Requests
When rate limited, you'll receive:
{
"error": {
"message": "Rate limit exceeded",
"retry_after": 60
}
}
Pro Tip
Implement exponential backoff when
you receive a 429 response. The retry_after
header tells you exactly how many seconds to wait before retrying.