Getting Started
LLM Resayil is an OpenAI-compatible API that lets you access 45+ open-source and cloud LLM models with flexible billing. Any OpenAI SDK works seamlessly by overriding the base URL.
Setup in 5 Steps
- Register at llm.resayil.io/register
- Subscribe at /billing/plans — choose a plan or start your free 7-day trial
- Create API Key at /api-keys — click "Create Key" and save it (shown only once)
- Make your first call:
curl https://llm.resayil.io/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "llama3.2:3b",
"messages": [{"role": "user", "content": "Hello!"}]
}'
- Track usage at /dashboard
How do I authenticate API requests?
Every API request requires authentication using your API key in the Authorization header.
Header Format
Authorization: Bearer YOUR_API_KEY
Getting Your API Key
Visit /api-keys to create and manage keys. Your key is shown only once at creation — store it securely.
Key Limits by Plan
| Plan | Max API Keys |
|---|---|
| Starter | 1 key |
| Basic | 2 keys |
| Pro | 3 keys |
| Enterprise | Unlimited |
Security Best Practices
- Never commit API keys to version control — use environment variables
- Rotate keys regularly
- Use separate keys per application or environment
- Revoke keys immediately if compromised
- Omit keys from error messages and logs
401 Unauthorized
How do I send a chat completion request?
The base URL for all API requests is:
https://llm.resayil.io/api/v1
POST /api/v1/chat/completions
Send messages to a model and get a completion response. Supports streaming via the stream parameter.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | Model ID from GET /api/v1/models |
messages |
array | Yes | Array of message objects: {"role": "user|assistant", "content": "text"} |
stream |
boolean | No | Default false. Set to true for Server-Sent Events streaming |
temperature |
number | No | Sampling temperature (0–2), default 1.0 |
max_tokens |
integer | No | Maximum tokens to generate |
Example Request
curl https://llm.resayil.io/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "llama3.2:3b",
"messages": [
{"role": "user", "content": "What is 2 + 2?"}
],
"temperature": 0.7,
"max_tokens": 100
}'
Example Response
{
"id": "chatcmpl-abc123def456",
"object": "chat.completion",
"created": 1740000000,
"model": "llama3.2:3b",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "2 + 2 equals 4."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 9,
"total_tokens": 33
}
}
GET /api/v1/models
List all available models. Returns an array of model objects with metadata.
Example Response
{
"object": "list",
"data": [
{
"id": "llama3.2:3b",
"object": "model",
"owned_by": "meta",
"context_window": 8192,
"credit_cost_multiplier": 1,
"is_active": true
},
{
"id": "qwen2.5:7b",
"object": "model",
"owned_by": "alibaba",
"context_window": 131072,
"credit_cost_multiplier": 1,
"is_active": true
},
{
"id": "claude-3-sonnet-cloud",
"object": "model",
"owned_by": "anthropic",
"context_window": 200000,
"credit_cost_multiplier": 2,
"is_active": true
}
]
}
Which AI models are available?
Access 45+ LLM models spanning local open-source and cloud providers. Fetch available models using:
curl https://llm.resayil.io/api/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
Model Families
| Family | Provider | Description |
|---|---|---|
| Llama | Meta | General-purpose chat and reasoning |
| Qwen | Alibaba | Multilingual chat and coding |
| Gemma | Lightweight and efficient | |
| DeepSeek | DeepSeek AI | Code and reasoning specialists |
| Mistral | Mistral AI | Fast, European open models |
| GLM | Zhipu AI | Chinese + English bilingual |
Credit Costs
| Model Type | Credits per Token |
|---|---|
| Local models | 1 credit |
| Cloud models | 2 credits |
Each API request consumes credits based on total tokens (prompt + completion) multiplied by the model's credit multiplier. Check your model list response for the credit_cost_multiplier field.
Billing & Credits
LLM Resayil uses a credit-based system. Each subscription plan includes monthly credits, and additional credits can be purchased via top-up packs.
Credit Costs by Model Type
| Model Type | Credits per Token |
|---|---|
| Local models (Llama, Qwen, etc.) | 1 credit |
| Cloud models (Claude, GPT, etc.) | 2 credits |
Monthly Plans
| Plan | Monthly Price | Credits Included | Rate Limit |
|---|---|---|---|
| Starter | 15 KWD | 5,000 | 10 req/min |
| Basic | 25 KWD | 15,000 | 10 req/min |
| Pro | 45 KWD | 50,000 | 30 req/min |
| Enterprise | Contact sales | Custom | 60 req/min |
Free Trial
New accounts receive a 7-day free trial with 5,000 trial credits. No payment method required.
Credit Top-ups
When your monthly credits run out, purchase additional credits:
| Credits | Price |
|---|---|
| 5,000 | 2 KWD |
| 15,000 | 5 KWD |
| 50,000 | 15 KWD |
402 Payment Required when your account credits are depleted. Top up at /billing/plans to resume access.
Monitoring Usage
Track your credit balance and usage breakdown in your dashboard.
What are the API rate limits?
API requests are rate-limited on a per-key basis using a rolling 1-minute window.
Rate Limits by Plan
| Plan | Requests per Minute |
|---|---|
| Starter | 10 |
| Basic | 10 |
| Pro | 30 |
| Enterprise | 60 |
Exceeding Limits
When you exceed your rate limit, the API returns a 429 Too Many Requests response:
{
"error": {
"code": "429",
"message": "Rate limit exceeded. Max 10 requests per minute."
}
}
Recommended Strategy
Implement exponential backoff when receiving 429 responses:
- First retry: wait 1 second
- Second retry: wait 2 seconds
- Third retry: wait 4 seconds
- And so on, doubling each time
Upgrade Your Plan
Need higher limits? upgrade your subscription or contact support for Enterprise tier options.
What errors can the API return?
All error responses follow this format:
{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message"
}
}
Common Errors
Unauthorized
When it occurs: Missing, invalid, or expired API key.
Example response:
{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key"
}
}
Resolution: Verify your API key at /api-keys or generate a new one.
Payment Required
When it occurs: Account has insufficient credits to process the request.
Example response:
{
"error": {
"code": "insufficient_credits",
"message": "Insufficient credits. Please top up your account."
}
}
Resolution: Top up credits at /billing/plans.
Too Many Requests
When it occurs: You've exceeded your plan's rate limit within the current 1-minute window.
Example response:
{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Max 10 requests per minute."
}
}
Resolution: Retry with exponential backoff, or upgrade your plan for higher limits.
Service Unavailable
When it occurs: The API or a model service is temporarily unavailable.
Example response:
{
"error": {
"code": "service_unavailable",
"message": "Model service is temporarily unavailable. Please retry shortly."
}
}
Resolution: Wait a few moments and retry. Check system status for ongoing incidents.
Code Examples
Below are complete working examples in multiple languages and platforms. Replace YOUR_API_KEY with your actual key.
cURL
Make API calls directly from the command line:
curl https://llm.resayil.io/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "llama3.2:3b",
"messages": [
{"role": "user", "content": "Tell me a joke."}
]
}'
Python
Use the official OpenAI Python library with LLM Resayil:
# pip install openai
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://llm.resayil.io/api/v1"
)
response = client.chat.completions.create(
model="llama3.2:3b",
messages=[
{"role": "user", "content": "Tell me a joke."}
]
)
print(response.choices[0].message.content)
JavaScript
Use the official OpenAI JavaScript library:
// npm install openai
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'YOUR_API_KEY',
baseURL: 'https://llm.resayil.io/api/v1',
});
const completion = await client.chat.completions.create({
model: 'llama3.2:3b',
messages: [
{ role: 'user', content: 'Tell me a joke.' },
],
});
console.log(completion.choices[0].message.content);
n8n Workflow Integration
Integrate LLM Resayil into n8n workflows using the HTTP Request node:
- Add an HTTP Request node to your workflow
- Set Method to
POST - Set URL to
https://llm.resayil.io/api/v1/chat/completions - Go to Authentication tab, select Generic Credential Type
- Choose Header Auth:
- Name:
Authorization - Value:
Bearer YOUR_API_KEY
- Name:
- In the Body tab, set Content Type to
JSON - Paste the request body:
{
"model": "llama3.2:3b",
"messages": [
{
"role": "user",
"content": "{{ $json.input }}"
}
]
}
- To extract the response, reference:
{{ $json.choices[0].message.content }}
Frequently Asked Questions
What models are available on LLM Resayil?
LLM Resayil provides access to 45+ AI models including Llama 3.2, DeepSeek V3.1 671B, Qwen 3.5 397B, GLM-4 Flash, and more. Local models run on our GPU server; cloud proxy models are routed through ollama.com.
Is LLM Resayil compatible with OpenAI's API?
Yes. LLM Resayil is fully OpenAI-compatible. Change your base URL to https://llm.resayil.io/api/v1 and use your LLM Resayil API key — no other code changes needed.
How do credits work?
Credits are consumed per token. Local models cost 1 credit/token; cloud models cost 2 credits/token. You can purchase top-ups: 5,000 credits for 2 KWD, 15,000 for 5 KWD, or 50,000 for 15 KWD.
What payment methods are accepted?
We accept KNET (Kuwait debit/credit cards) via MyFatoorah payment gateway. All payments are processed securely.
Can I use LLM Resayil for commercial projects?
Yes. There are no restrictions on commercial use. API access is pay-per-token with no monthly minimums.
What are the rate limits per tier?
Free tier: 10 requests/minute. Standard tier: 30 requests/minute. Premium tier: 60 requests/minute. Rate limits reset every minute.
How do I get started with the API?
Register at llm.resayil.io, go to your dashboard to create an API key, add credits via KNET, then set your base URL to https://llm.resayil.io/api/v1.
Is there a free trial?
New accounts receive a small credit allocation on signup to test the API. No credit card required to register.