Concepts
Errors
Every failure, whether the gateway or a service raised it, comes back in one envelope with a stable code. The HTTP status tells you the class of failure, and every response carries an x-request-id.
The envelope
{
"error": {
"type": "not_found",
"code": "PROJECT_NOT_FOUND",
"message": "project not found: prj_missing",
"request_id": "a3c8a39c-624c-4fd5-bc1f-02750c840a0b",
"docs_url": "https://os.one.ml/api/v1/errors#PROJECT_NOT_FOUND",
"layer": "hives"
}
}| Field | When | Meaning |
|---|---|---|
type | always | The class, matching the status: unauthorized, forbidden, not_found, rate_limited… |
code | always | Stable and machine-readable. Branch on this, never on message. |
message | always | One sentence for people. It can change. |
request_id | always | The same value as the x-request-id header. |
docs_url | always | The code's entry in the catalog for the gateway's codes; for a service's own code, the operation's page in the API reference lists its statuses. |
layer | when a service raised it | The service that refused, for example hives or silos. |
required_scope | on SCOPE_MISSING | The scope the operation needs. |
Where codes come from
- The gateway's own codes (
CREDENTIAL_INVALID,SCOPE_MISSING,RATE_LIMITED…) are listed at Error codes, 295 in all, and as JSON athttps://os.one.ml/api/v1/errors. - A service's own code passes through as the service named it, with
layerset:PROJECT_NOT_FOUNDfrom Hives, for example. Service codes are not in the gateway's catalog. - A service refusal with no code gets
UPSTREAM_<status>, such asUPSTREAM_404, and the service's message.
By status
| Status | What happened | What to do |
|---|---|---|
400 | The path, query, header or body failed validation. | Fix the request; retrying the same request fails the same way. |
401 | No credential, or one that is invalid, expired or revoked. | Send one Authorization: Bearer header with a live credential. |
403 | The credential is valid but may not do this, often SCOPE_MISSING. | Use a credential with required_scope, or a signed-in session. |
404 | No such route, or no such resource in your organization. | Check the path and id. |
409 | The resource changed or already exists. | Read the current state, then decide. |
422 | The body is well-formed but not acceptable. | Fix the field the message names. |
429 | Too many requests for this principal. | Wait Retry-After seconds. See Rate limits. |
502 504 | The service answered badly or too slowly. | Retry reads with backoff; for writes, see Idempotency. |
503 | The service is unavailable or not enabled here. | Check Status; honour Retry-After when present. |
In the SDK, CLI and MCP
import { GenesisError, errorCatalog } from '@onesi/genesis'
try {
await genesis.call('hives_delete_project', { project_id })
} catch (e) {
if (!(e instanceof GenesisError)) throw e
// e.status, e.type, e.code, e.message and e.requestId; errorCatalog(e) adds required_scope and docs_url.
console.error(e.status, e.code, e.requestId, errorCatalog(e).required_scope)
}genesis --json hives projects delete prj_doesnotexist
# {"error":{"type":"not_found","status":404,"message":"project not found: prj_doesnotexist","request_id":"…","code":"PROJECT_NOT_FOUND","docs_url":"https://os.one.ml/api/v1/errors#PROJECT_NOT_FOUND"}}{
"isError": true,
"content": [{ "type": "text", "text": "{ \"error\": { \"type\": \"not_found\", \"status\": 404, \"message\": \"project not found: prj_doesnotexist\", \"request_id\": \"…\", \"code\": \"PROJECT_NOT_FOUND\", \"docs_url\": \"…\" } }" }]
}When you contact support, include the request_id.
L1fe AI Inc. · Built from Genesis 0.3.3 and the live gateway on 2026-10-25. Support