Skip to main content
Source Code: src/gaia/api/
The GAIA API Server implements a subset of OpenAI’s Chat Completions API with GAIA agents exposed as “models”.
Base URL: http://localhost:8080 (default) Architecture:

Endpoints

Health Check

GET /health

Check server health status
Response:
Example:

List Models

GET /v1/models

List available GAIA agent models
Response Schema:
Example:

Chat Completions

POST /v1/chat/completions

Create chat completion using a GAIA agent
Supports both streaming (SSE) and non-streaming responses.

Request Parameters

Message Object


Non-Streaming Response


Streaming Response


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
Capabilities:
  • 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/models
  • messages array with roles
  • temperature, max_tokens, top_p
  • Server-Sent Events (SSE) streaming

❌ Not Supported

  • frequency_penalty, presence_penalty
  • functions and tools parameters
  • response_format parameter
  • logprobs, n, stop parameters
  • /v1/embeddings, /v1/audio/*, /v1/images/*

Adding New Agents

1

Create Agent Class

2

Register in Agent Registry

3

Restart Server


Security

Designed for local development only. Not production-ready.
Current Implementation:
  • ❌ No authentication
  • ❌ No rate limiting
  • ✅ CORS enabled (all origins)
For Production Deployment:
  • 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