Introduction
The External API allows you to integrate Junis AI agents into your own applications. Use your API key to invoke agents, manage sessions, and build powerful AI-powered features.External API requires an active subscription (Basic or Pro). Credits are consumed for each API call.
Base URL
Authentication
All External API requests require an API key in theX-API-Key header:
API Key Scopes
API keys can be created with specific scopes to limit access:| Scope | Description |
|---|---|
orchestrator:invoke | Invoke the main orchestrator via chat completions |
agents:list | List available agents in organization |
agents:invoke | Invoke individual agents directly |
sessions:read | Read session history and messages |
rag:upload | Upload files to RAG Datastore |
rag:read | Read RAG uploads and DataStores |
Available Endpoints
OpenAI-Compatible
Chat Completions
POST /v1/chat/completions - OpenAI-compatible chat APIAgent Management
List Agents
GET /agents - List available agentsInvoke Agent
POST /agents/{agent_id}/completions - Invoke specific agentSession Management
List Sessions
GET /sessions - List chat sessionsGet Messages
GET /sessions/{session_id}/messages - Get session messagesRAG Knowledge Base
Create DataStore
POST /rag/datastores - Create new DataStoreUpload Files
POST /rag/upload - Upload files to DataStoreList Uploads
GET /rag/uploads - List upload historyList DataStores
GET /rag/datastores - List DataStoresQuick Start
1. Get Your API Key
- Go to Admin > API Keys
- Click Create API Key
- Select required scopes
- Copy and securely store the key (shown only once)
2. Make Your First Call
3. Parse the Response
SDK Support
OpenAI Python SDK
OpenAI Node.js SDK
Streaming
Enable streaming for real-time responses:Rate Limits
| Plan | Requests/min | Concurrent requests |
|---|---|---|
| Basic | 60 | 5 |
| Pro | 300 | 20 |
Rate limit headers are included in all responses:
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.Error Handling
All errors follow a consistent format:Common Error Codes
| Code | Status | Description |
|---|---|---|
invalid_api_key | 401 | API key is invalid or revoked |
insufficient_credits | 402 | Not enough credits for request |
rate_limit_exceeded | 429 | Too many requests |
scope_not_allowed | 403 | API key lacks required scope |
agent_not_found | 404 | Specified agent doesn’t exist |
Related
Chat Completions
OpenAI-compatible chat API
Agent API
Individual agent invocation
