Source Code:
src/gaia/api/The GAIA API Server implements a subset of OpenAI’s Chat Completions API with GAIA agents exposed as “models”.
http://localhost:8080 (default)
Architecture:
Endpoints
Health Check
GET /health
Check server health status
List Models
GET /v1/models
List available GAIA agent models
Chat Completions
POST /v1/chat/completions
Create chat completion using a GAIA agent
Request Parameters
Message Object
Non-Streaming Response
- Request
- Response
Streaming Response
- Request
- Response (SSE)
Available Models
gaia-code
Autonomous Code Development
Python/TypeScript development agent with intelligent routing
Requirements:
- Lemonade Server with
--ctx-size 32768 - Model:
Qwen3.5-35B-A3B-GGUF
- Code generation (functions, classes, projects)
- Test generation
- Linting & formatting (pylint, Black)
- Error detection and correction
- Project scaffolding
- Architectural planning
Error Responses
All errors follow OpenAI’s error format.400 - Bad Request
404 - Model Not Found
500 - Internal Server Error
OpenAI API Compatibility
Supported Features
✅ Supported
/v1/chat/completions(streaming & non-streaming)/v1/modelsmessagesarray with rolestemperature,max_tokens,top_p- Server-Sent Events (SSE) streaming
❌ Not Supported
frequency_penalty,presence_penaltyfunctionsandtoolsparametersresponse_formatparameterlogprobs,n,stopparameters/v1/embeddings,/v1/audio/*,/v1/images/*
Adding New Agents
1
Create Agent Class
2
Register in Agent Registry
3
Restart Server
Security
Current Implementation:- ❌ No authentication
- ❌ No rate limiting
- ✅ CORS enabled (all origins)
- Implement API key authentication
- Add rate limiting middleware
- Configure CORS restrictions
- Use HTTPS with valid certificates
See Also
API Server Guide
Usage examples and integration guides
Code Agent
Code agent capabilities
Routing Guide
Intelligent language detection
VSCode Integration
VSCode extension setup