Skip to main content
Base URL: https://api.orchagent.io

OpenAPI Specification

The auto-generated OpenAPI spec is available at:
https://api.orchagent.io/openapi.json
Import this into Postman, Insomnia, or any OpenAPI-compatible tool to explore all endpoints interactively.

Authentication

All authenticated endpoints require an API key in the Authorization header:
Authorization: Bearer {api_key}
Get your API key from the orchagent Dashboard.

Calling an Agent

Request Format

POST /{org}/{agent}/{version}/{endpoint}
Host: api.orchagent.io
Authorization: Bearer {api_key}
Content-Type: application/json
Accept: application/json

URL Parameters

ParameterDescriptionExample
orgOrganization slugacme
agentAgent nameinvoice-scanner
versionAgent versionv1
endpointAgent endpointanalyze

Optional Headers

HeaderDescription
X-Orchagent-Max-HopsMaximum call chain depth (for orchestrator agents)
X-Orchagent-TenantTenant ID for multi-tenant usage attribution
X-Orchagent-SkillsComma-separated skill refs to add (e.g., org/skill@v1,org/other@v1)
X-Orchagent-Skills-OnlyUse only these skills, ignoring agent defaults
X-Orchagent-No-SkillsSet to true to disable all skills
X-Orchagent-Deadline-MsRequest deadline as epoch milliseconds

Response Format

Success Response

{
  "data": {
    // Agent-specific response fields
  },
  "warnings": [
    {
      "code": "LOW_CONFIDENCE",
      "field": "amount",
      "message": "Amount extracted with low confidence"
    }
  ],
  "metadata": {
    "request_id": "req_abc123",
    "processing_time_ms": 1250,
    "version": "v1"
  }
}

Error Response

{
  "error": {
    "code": "DOCUMENT_TOO_LARGE",
    "message": "Document exceeds 25MB size limit",
    "is_retryable": false
  },
  "metadata": {
    "request_id": "req_abc123"
  }
}

Error Codes

CodeHTTP StatusRetryableDescription
INVALID_INPUT400NoRequest doesn’t match input schema
UNAUTHORIZED401NoInvalid or missing API key
FORBIDDEN403NoCaller lacks permission for this agent
NOT_FOUND404NoAgent or version doesn’t exist
DOCUMENT_TOO_LARGE413NoFile exceeds size limit
UNSUPPORTED_TYPE415NoFile type not supported
UNPROCESSABLE422NoValid format but cannot process content
INSUFFICIENT_CREDITS402NoNot enough credits to call this paid agent
RATE_LIMITED429YesToo many requests, retry after wait
TIMEOUT504YesRequest exceeded configured timeout
LLM_ERROR502YesUpstream LLM provider error
INTERNAL_ERROR500YesUnexpected agent error

File Upload

For agents that accept files, use multipart form data:
POST /{org}/{agent}/{version}/analyze
Content-Type: multipart/form-data

------Boundary
Content-Disposition: form-data; name="file"; filename="invoice.pdf"
Content-Type: application/pdf

{binary data}
------Boundary--

Multiple Files

To send multiple files, use the files[] array format:
POST /{org}/{agent}/{version}/analyze
Content-Type: multipart/form-data

------Boundary
Content-Disposition: form-data; name="files[]"; filename="doc1.pdf"
Content-Type: application/pdf

{binary data}
------Boundary
Content-Disposition: form-data; name="files[]"; filename="doc2.pdf"
Content-Type: application/pdf

{binary data}
------Boundary
Content-Disposition: form-data; name="metadata"
Content-Type: application/json

{"format":"detailed"}
------Boundary--

Code Runtime Agent Input Contract

When files are uploaded to a code runtime agent, the agent receives a JSON manifest via stdin:
{
  "files": [
    {
      "path": "/tmp/uploads/doc1.pdf",
      "original_name": "doc1.pdf",
      "content_type": "application/pdf",
      "size_bytes": 1234567
    },
    {
      "path": "/tmp/uploads/doc2.pdf",
      "original_name": "doc2.pdf",
      "content_type": "application/pdf",
      "size_bytes": 2345678
    }
  ],
  "metadata": {"format": "detailed"}
}
FieldDescription
files[].pathAbsolute path to the file in the sandbox
files[].original_nameOriginal filename from upload
files[].content_typeMIME type of the file
files[].size_bytesFile size in bytes
metadataOptional JSON metadata from the request
Your code runtime agent reads the files from their path locations and processes them.

Rate Limit Headers

Response headers indicate your limit status:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 995
X-RateLimit-Reset: 1704067200

Public Endpoints

These endpoints don’t require authentication:

List Public Agents

GET /public/agents

Get Agent Details

GET /public/agents/{org}/{agent}/{version}

Download Agent (for local execution)

GET /public/agents/{org}/{agent}/{version}/download
Returns the full agent data needed for local execution. Only works for agents with allow_local_download enabled.
  • Server-only agents (allow_local_download=false): Returns 403 DOWNLOAD_DISABLED
  • Paid agents: Returns 403 PAID_AGENT_SERVER_ONLY
  • Source-available agents (allow_local_download=true): Returns full agent data including prompt, manifest, and schemas
Response (source-available agent):
{
  "type": "tool",
  "name": "leak-finder",
  "version": "v1",
  "description": "Finds leaked secrets in your codebase",
  "run_mode": "on_demand",
  "execution_engine": "code_runtime",
  "callable": false,
  "source_url": "git+https://github.com/user/repo.git#subdirectory=leak-finder",
  "runtime": {
    "command": "python3 -m leak_finder.cli"
  }
}
The public detail endpoint (GET /public/agents/{org}/{agent}/{version}) also redacts prompt, manifest, and skill_files for server-only and paid agents. Only metadata (name, description, schemas, tags) is visible.

Authenticated Endpoints

Usage

EndpointDescription
GET /usageYour usage summary
GET /usage/timeseriesUsage over time
GET /usage/breakdownUsage by agent
GET /usage/logsDetailed call logs

API Keys

EndpointDescription
GET /api-keysList your API keys
POST /api-keysCreate new API key
DELETE /api-keys/{id}Delete API key

Agents

EndpointDescription
GET /agentsList your agents
POST /agentsRegister new agent
GET /agents/{id}Get agent details
PATCH /agents/{id}Update agent
POST /agents/{id}/uploadUpload code bundle (code runtime agents only)
GET /agents/{id}/logsGet execution logs (owner only)

Schedules

EndpointDescription
GET /workspaces/{id}/schedulesList schedules (filter by agent, type)
POST /workspaces/{id}/schedulesCreate cron or webhook schedule
GET /workspaces/{id}/schedules/{schedule_id}Get schedule details
PATCH /workspaces/{id}/schedules/{schedule_id}Update schedule (cron, timezone, enable/disable, alerts)
DELETE /workspaces/{id}/schedules/{schedule_id}Delete schedule
POST /workspaces/{id}/schedules/{schedule_id}/triggerManually trigger execution
GET /workspaces/{id}/schedules/{schedule_id}/eventsGet schedule events timeline
GET /workspaces/{id}/schedules/{schedule_id}/runsGet schedule run history
POST /workspaces/{id}/schedules/{schedule_id}/test-alertSend test alert to configured webhook
Public webhook endpoint (no authentication — URL contains secret):
EndpointDescription
POST /webhooks/{schedule_id}/{webhook_secret}Trigger agent via webhook (supports idempotency-key header)

Services

EndpointDescription
GET /workspaces/{id}/servicesList services
POST /workspaces/{id}/servicesDeploy a new service
GET /workspaces/{id}/services/{service_id}Get service details and events
PATCH /workspaces/{id}/services/{service_id}Update service config, env vars, and secrets
POST /workspaces/{id}/services/{service_id}/restartRestart a service
DELETE /workspaces/{id}/services/{service_id}Delete a service
GET /workspaces/{id}/services/{service_id}/logsGet service logs

Billing & Credits

EndpointDescription
GET /billing/balanceGet your credit balance
POST /billing/checkoutCreate Stripe Checkout session to add credits
GET /billing/transactionsList credit transactions (top-ups, charges, refunds)

Compute Usage

EndpointDescription
GET /usage/computeGet compute usage for sandbox agents

Versioning

Agents use URL-based versioning:
https://api.orchagent.io/{org}/{agent}/v1/analyze
https://api.orchagent.io/{org}/{agent}/v2/analyze
  • Authors increment version for breaking changes
  • Old versions remain accessible during 60-day deprecation period
  • Pin to specific versions in production

Deprecation Headers

When an agent version is deprecated:
HTTP/1.1 200 OK
Deprecation: true
Sunset: Sat, 1 Mar 2025 00:00:00 GMT
Link: </{org}/{agent}/v2/{endpoint}>; rel="successor-version"

Warnings Array

Successful responses may include warnings:
{
  "data": { ... },
  "warnings": [
    {
      "code": "LOW_CONFIDENCE",
      "field": "amount",
      "message": "Amount extracted with 60% confidence"
    }
  ]
}
Standard warning codes:
CodeDescription
LOW_CONFIDENCEField value uncertain
TRUNCATEDData was truncated
DEPRECATED_FIELDField will be removed in next version
VALIDATION_SKIPPEDCouldn’t validate a field