Introduction
The Artanis REST API provides a direct HTTP interface for AI observability, enabling you to use Artanis from any programming language or environment. This is particularly useful when:- You’re using a language without an official SDK (e.g., Haskell, Go, Rust)
- You need fine-grained control over HTTP requests
- You’re integrating with existing HTTP clients or frameworks
- You prefer not to add SDK dependencies
The REST API exposes the same endpoints that our official SDKs use internally, ensuring feature parity and reliability.
Base URL
All API requests should be made to:Authentication
All requests require authentication using a Bearer token in theAuthorization header:
Required Headers
Include these headers in all requests:| Header | Value | Description |
|---|---|---|
Authorization | Bearer ak_... | Your Artanis API key |
Content-Type | application/json | All requests use JSON |
Quick Example: Complete Trace
Here’s a minimal example showing how to create a complete trace with input and output:Core Concepts
Traces
A trace represents a single operation (e.g., answering a question, classifying a ticket). Each trace:- Has a unique client-generated ID (format:
trace_+ 22 random alphanumeric characters) - Starts with
status: "running"and ends withstatus: "completed" - Can have associated metadata for filtering and searching
Observations
Observations capture the data flowing through your operation:- input: Data going into the operation (questions, prompts, parameters)
- output: The final result (response, classification, answer)
- state: Context needed for replay (document IDs, config, retrieved chunks)
Fire-and-Forget Pattern
The REST API follows a fire-and-forget pattern - requests are accepted and processed asynchronously. The official SDKs implement this same behavior with <0.1ms overhead.
- Return immediately (typically 202 Accepted)
- Don’t guarantee synchronous validation
- Prioritize low latency over immediate error feedback
Error Handling
The API uses standard HTTP status codes:| Code | Meaning | Action |
|---|---|---|
| 202 | Accepted | Request received and queued for processing |
| 400 | Bad Request | Check request format and required fields |
| 401 | Unauthorized | Verify your API key is correct |
| 413 | Payload Too Large | Reduce data size (max ~1MB per request) |
| 429 | Rate Limited | Implement exponential backoff |
| 500 | Server Error | Retry with exponential backoff |