Back to Documentation
AMADEV Docs
AmaStudio

AmaStudio API Reference

API endpoints used by AmaStudio on amadev.org — authentication, chat, knowledge, and agent runtime.

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
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:

CodeMeaning
401Missing or invalid API key
403Key valid but insufficient permissions
400Invalid request or unsupported model
502Upstream AI provider error