mosoodocs

Errors and limits

Handle mosoo API errors, retries, idempotency, and public API limits.

All non-2xx JSON errors use the same envelope:

{
  "error": {
    "code": "invalid_request",
    "message": "Request body must be an object."
  }
}

Branch on error.code, not error.message. The message is for developers and should not be shown directly to end users.

Error codes

HTTPerror.codeCaller action
400invalid_requestFix request shape, field value, body size, or unsupported field. Do not retry unchanged.
400invalid_jsonFix serialization or Content-Type.
401unauthenticatedCheck Authorization; rotate or recreate the API token.
403forbiddenCheck that the API token can access this Agent, Thread, or file.
404not_foundCheck that the ID exists and is visible to this API token.
409agent_not_publishedPublish the Agent and enable API access.
409service_inactiveRepublish or repair the Agent in mosoo.
409readiness_blockedFix Agent readiness or configuration in mosoo.
409idempotency_conflictWait for Retry-After if in-flight, or use a new key when the body differs.
429rate_limitedBack off and retry after Retry-After.
500internal_errorRetry briefly with backoff; persist failure details if it repeats.

Idempotency

Idempotency-Key is supported on:

  • POST /agents/{agentId}/threads
  • POST /threads/{threadId}/events

Rules:

  • For Project keys, the idempotency key is scoped to the Project, method, and route; the body is checked for conflicts. Keys in the same Project share receipts and rate limits, including after rotation. Account CLI credentials use their own credential boundary.
  • Reusing the same key with the same request replays the stored response.
  • Reusing the same key with a different request returns 409 idempotency_conflict.
  • Reusing the key while the first request is still processing returns 409 idempotency_conflict.
  • Keys must be non-empty and 128 characters or fewer.
  • Conflict responses can include Retry-After.

Public limits

LimitValue
Create Thread input text32000 characters
userId255 characters
File ID26 characters
File upload67108864 bytes
Event list default100 events
Event list maximum1000 events
Thread list maximum100 Threads

On this page