API
The Inspect API lets your code start and prompt sessions, read their messages, diffs, and cost, and manage agents, skills, automations, memories, artifacts, and repositories. The endpoint reference is generated from the OpenAPI schema and listed in the navigation. To use the same API from an AI tool, connect Inspect MCP.
Base URL
Every endpoint is under:
https://app.inspect.com/api/v2Authentication
Send an API key as a bearer token:
curl 'https://app.inspect.com/api/v2/sessions' \
--header "Authorization: Bearer $INSPECT_API_KEY"A request acts as the key's owner, with that person's permissions and repository access. Sessions created with a personal key open pull requests under the owner's GitHub account. System keys act as a system user and open pull requests as Inspect. See API keys for both types.
Requests
Request bodies are validated strictly. A body with a field the endpoint doesn't define, including inside a nested object, fails with 400 and a message that names the field, such as Unrecognized key: "promt". Map fields such as variables accept any keys, and free-form JSON fields such as output_schema accept any content. Unknown query parameters are ignored.
Rate limits
Limits are counted per caller and per organization over one-minute windows.
| Requests | Per caller | Per organization |
|---|---|---|
Any /api/v2 endpoint | 1,200 per minute per API key | 12,000 per minute |
POST /api/v2/sessions | 120 per minute | 1,200 per minute |
POST /api/v2/sessions/{session_id}/prompt | 120 per minute | 1,200 per minute |
A request over a limit can be rejected with 429, a Retry-After: 60 header, and this body:
{ "message": "Too many requests. Try again shortly.", "code": "rate_limited" }Back off for the Retry-After interval before retrying.
Errors
Errors return JSON with a human-readable message and a machine-readable code. Each endpoint's reference lists the codes it can return. Common ones:
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request_body | The body failed validation. |
| 400 | malformed_json | The body isn't valid JSON. |
| 400 | invalid_cursor | The pagination cursor is invalid. |
| 401 | unauthenticated | The API key is missing, malformed, revoked, or belongs to a deactivated user. |
| 403 | read_only_api_key | The key is read-only and the request makes a change. |
| 403 | repository_not_allowed | The key is limited to other repositories. |
| 403 | api_key_ip_not_allowed | The request came from an address outside your organization's API key IP allowlist. |
| 403 | api_key_scope_not_allowed | The key's scopes don't cover this endpoint. |
| 404 | session_not_found, not_found | The resource doesn't exist or the key's owner can't see it. |
| 409 | session_cost_limit_reached | The session reached a spend limit. A soft limit can be continued from the session page. |
| 429 | rate_limited | See Rate limits. |
| 502, 504 | upstream_error, upstream_timeout | A service Inspect depends on failed or timed out. Retry. |