AmaStudio API Reference
AmaStudio communicates with https://api.amadev.org/v1/ for cloud features. All API calls require authentication via API key.
Authentication
Two header formats are accepted:
Code
X-API-Key: amallm_YOUR_API_KEY
Authorization: Bearer amallm_YOUR_API_KEY
Endpoints
Create API Key
Code
POST /v1/keys
Content-Type: application/json
{
"name": "AmaStudio Key"
}
Response:
Code
{
"key": "amallm_..."
}
List API Keys
Code
GET /v1/keys
Chat Completions (OpenAI-compatible)
Code
POST /v1/chat/completions
Content-Type: application/json
{
"model": "groq/compound",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true
}
Messages (Anthropic Messages API format)
Code
POST /v1/messages
Content-Type: application/json
{
"model": "groq/compound",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true
}
Supports streaming with Anthropic-style SSE events.
List Models
Code
GET /v1/models
Login with Credentials
Code
POST /v1/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "your-password"
}
Validates API key
Code
GET /v1/keys/validate
X-API-Key: amallm_YOUR_KEY
Knowledge Base: Create
Code
POST /v1/knowledge
Content-Type: application/json
{
"name": "My Knowledge Base",
"description": "Project documentation"
}
Knowledge Base: List
Code
GET /v1/knowledge
Knowledge Base: Upload Document
Code
POST /v1/knowledge/:id/documents
Content-Type: multipart/form-data
file: @document.pdf
Knowledge Base: Search
Code
POST /v1/knowledge/:id/search
Content-Type: application/json
{
"query": "search terms",
"limit": 10
}
Agent: List Sessions
Code
GET /v1/agents/sessions
Agent: Create Session
Code
POST /v1/agents/sessions
Content-Type: application/json
{
"agentId": "agent-id",
"name": "Debug Session"
}
Agent: Send Message
Code
POST /v1/agents/sessions/:id/messages
Content-Type: application/json
{
"role": "user",
"content": "What's the status?"
}
Error Responses
Code
{
"error": {
"message": "Unauthorized",
"code": 401
}
}
Common errors:
| Code | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 403 | Key valid but insufficient permissions |
| 400 | Invalid request or unsupported model |
| 502 | Upstream AI provider error |
