Observability
Search request history, query metrics and connect your own tools. These APIs use the history service base URL below.
- Base URL
- https://alapi.deep.sa/v1/observability
Authentication & permissions
Create an API key and expand “Account history access”. Send it as an Authorization: Bearer token to the history service; keep it on your server.
Create an integration key| Permission | API identifier | Access |
|---|---|---|
| Request history | observability_read | Read timing, errors, usage and analytics for your whole account. Does not include saved inputs or outputs. |
| Saved content | observability_content | Also requires Request history. View and search saved inputs and outputs. |
| History export | observability_export | Also requires Request history. Bulk-export records and traces; saved content still needs its own permission. |
| Alert rules | observability_write | Create, update and pause alert rules for your account. |
All endpoints require Request history. Add Saved content to read available inputs and outputs, History export to download records, or Alert rules to create and update alerts. Permissions cover your entire account, regardless of the key’s product permissions.
Lists, metrics, synchronization and bulk exports contain metadata only. Request details can include saved content when permitted and available. Saved content is deleted automatically 30 days after the request. ZDR prevents saving new content; it does not remove existing saved content or operational metadata.
Search & request details
Use POST search to keep search text out of URLs. Results contain data and next_cursor; request lists do not include saved inputs or outputs.
curl 'https://alapi.deep.sa/v1/observability/requests/search' \
-H 'Authorization: Bearer YOUR_HISTORY_KEY' \
-H 'Content-Type: application/json' \
-d '{"range":"24h","product":"llm","outcome":"failed","limit":50}'
Filters: range (24h, 7d, 30d, all), product (llm, embedding, guardrail, ocr, retrieval), application, environment, release, model, outcome, status, error_code and q. Page limit: 1–100. Search text q belongs in the POST body.
To continue a search, send next_cursor as cursor with the same filters. An empty cursor ends the result set. History is best effort: records may arrive late or be missing. Respect Retry-After on 429 responses.
Application, environment and release are optional labels supplied with X-Alapi-Application, X-Alapi-Environment and X-Alapi-Release on your API calls. Use 1–48 letters, digits, hyphens or underscores, starting with a letter or digit; do not put personal data or secrets in labels. A valid W3C traceparent can correlate gateway execution with your own traces. These labels and IDs grant no access.
| Endpoint | Access |
|---|---|
GET /v1/observability/requests | List metadata using URL filters. Use POST search for text queries. |
GET /v1/observability/requests/{request_id} | One request; saved content requires the additional Saved content permission and available content. |
GET /v1/observability/requests/{request_id}/export | Download one request with History export; Saved content is also required to include available saved inputs and outputs. |
POST /v1/observability/traces/searchGET /v1/observability/traces/{trace_id} | Search gateway traces or retrieve one by trace ID, within your account. |
GET /v1/observability/alertsPOST /v1/observability/alerts | Read alert rules and events. POST additionally requires Alert rules to create or update a rule. |
Aggregated metrics
Time buckets, errors, tokens and estimated SAR costs, scoped to your account. Needs a key with the “Request history” permission.
curl 'https://alapi.deep.sa/v1/observability/metrics?range=24h' \
-H 'Authorization: Bearer YOUR_HISTORY_KEY'
Returns summary, delivery and completeness. The summary includes counts, latency, errors, tokens and estimated costs; POST /v1/observability/metrics also accepts search filters in JSON.
Synchronize records
Each page returns a checkpoint; save it only after the page is processed. Record IDs are stable, so repeats can be deduplicated. Only records still within the saved history window are replayed, and a few can arrive late or be missing. Needs a key with the “Request history” permission.
curl 'https://alapi.deep.sa/v1/observability/sync?limit=100' \
-H 'Authorization: Bearer YOUR_HISTORY_KEY'
Returns data, checkpoint and has_more. After processing each page, save checkpoint and pass it on the next call. Continue while has_more is true, then poll with the saved checkpoint for new records. Only checkpoint and limit are accepted. Checkpoints expire after 30 days; a 400 invalid checkpoint or 409 sync_reset_required requires restarting without a checkpoint and deduplicating records. Sync is not a deletion feed: manage retention of your own copies separately.
Export & OpenTelemetry
Export alAPI gateway steps as OTLP/HTTP JSON and combine them with your own application activity in your existing tools. Needs a key with the “Request history” and “History export” permissions.
curl -X POST 'https://alapi.deep.sa/v1/observability/requests/export' \
-H 'Authorization: Bearer YOUR_HISTORY_EXPORT_KEY' \
-H 'Content-Type: application/json' \
-d '{"range":"24h","limit":100,"format":"otlp-json"}' \
--output alapi-traces.json
Bulk export formats: json, csv, otlp-json and otlp (Protobuf). JSON returns next_cursor; CSV and OTLP return X-Next-Cursor. Continue with cursor and unchanged filters. All bulk formats omit request and response content. OTLP is a downloadable file: forwarding it to your collector runs in your environment.
Your collector and its credentials stay in your environment. We do not require access to your internal application activity. Deleting history or enabling ZDR in alAPI does not delete copies you have already exported.
Ready to Get Started?
Generate an API key from your dashboard and start building