Build with SwisserAI API
OpenAI-compatible API with built-in FiveM expertise. Use it with Cursor, Continue, Roo Code, or any OpenAI client.
Important: Managing API Costs
Tools like Roo Code and Cursor send the entire conversation history with each request to produce high-quality results. This means token usage grows significantly as conversations get longer.
Our recommendation: Prompt for one thing at a time and start fresh conversations regularly, rather than keeping long conversations going. This keeps your API costs predictable.
OpenAI Compatible
Drop-in replacement for OpenAI API. Works with any client that supports the OpenAI chat completions endpoint.
FiveM Expertise Built-in
Every request includes our specialized FiveM knowledge - QBCore, ESX, natives, NUI design patterns, and more.
Tool Use Support
Full support for function calling and tool use. Perfect for AI coding assistants like Roo Code or Cursor.
IDE Integration
Works with Cursor, Continue, Roo Code, Windsurf and any tool supporting OpenAI-compatible APIs.
Quick Start
Get your API Key
Create an API key in your account settings. Keep it secure - it provides full access to your account.
Go to SettingsMake your first request
curl https://ai.swisser.dev/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "swisserai-free",
"messages": [
{"role": "user", "content": "Create a QBCore job system"}
]
}'IDE & Tool Integrations
SwisserAI works with any tool that supports OpenAI-compatible APIs. Here are setup guides for popular options.
AI-first code editor with built-in AI features. Requires Pro or Business subscription for custom models.
Open-source AI code assistant for VS Code and JetBrains. Free to use with any OpenAI-compatible API.
Autonomous AI coding agent for VS Code. Works great with SwisserAI for FiveM development.
Note: GitHub Copilot and Cody (Sourcegraph) do not support custom OpenAI-compatible providers in their standard plans. Enterprise users may have limited options.
Error Handling
Handle API errors gracefully with proper status code checking:
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'YOUR_API_KEY',
baseURL: 'https://ai.swisser.dev/v1',
});
try {
const response = await client.chat.completions.create({
model: 'swisserai-free',
messages: [{ role: 'user', content: 'Hello' }],
});
console.log(response.choices[0].message.content);
} catch (error) {
if (error instanceof OpenAI.APIError) {
switch (error.status) {
case 401:
console.error('Invalid API key - check your credentials');
break;
case 402:
console.error('Insufficient credits - top up at /settings/billing');
break;
case 429:
console.error('Rate limit exceeded - wait before retrying');
break;
case 500:
console.error('Server error - retry after a moment');
break;
default:
console.error('API error:', error.message);
}
}
}API Reference
Base URL
https://ai.swisser.dev/v1Available Models
| Model | Description | Best For |
|---|---|---|
| swisserai-free | Standard model with FiveM expertise | General FiveM development |
| swisserai-premium | Advanced model (requires premium tier) | Complex scripts, production code |
Endpoints
/v1/chat/completionsCreate a chat completion. Supports streaming and tool use.
/v1/modelsList available models.
Error Codes
| Code | Meaning | Solution |
|---|---|---|
| 400 | Bad Request | Check your request format and parameters |
| 401 | Invalid API Key | Verify your API key is correct and active |
| 402 | Insufficient Credits | Add credits to your account at /settings/billing |
| 429 | Rate Limit Exceeded | Wait before retrying, or upgrade your tier |
| 500 | Server Error | Retry after a moment. Contact support if persistent |
SwisserAI Extensions
You can pass additional parameters in the swisserai object to customize behavior:
{
"model": "swisserai-free",
"messages": [...],
"swisserai": {
"framework": "qbcore", // or "esx", "qbox", "standalone"
"proMode": false, // Enable modular architecture mode
"ragEnabled": true // Enable RAG context (default: true)
}
}Rate Limits
Rate limits are based on your subscription tier:
| Tier | Requests / Hour |
|---|---|
| Free | 30 |
| Hobby | 50 |
| Pro | 100 |
| Team | 150 |
Ready to get started?
Create your API key and start building FiveM scripts with AI assistance today.