Inspect

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/v2

Authentication

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.

RequestsPer callerPer organization
Any /api/v2 endpoint1,200 per minute per API key12,000 per minute
POST /api/v2/sessions120 per minute1,200 per minute
POST /api/v2/sessions/{session_id}/prompt120 per minute1,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:

StatusCodeMeaning
400invalid_request_bodyThe body failed validation.
400malformed_jsonThe body isn't valid JSON.
400invalid_cursorThe pagination cursor is invalid.
401unauthenticatedThe API key is missing, malformed, revoked, or belongs to a deactivated user.
403read_only_api_keyThe key is read-only and the request makes a change.
403repository_not_allowedThe key is limited to other repositories.
403api_key_ip_not_allowedThe request came from an address outside your organization's API key IP allowlist.
403api_key_scope_not_allowedThe key's scopes don't cover this endpoint.
404session_not_found, not_foundThe resource doesn't exist or the key's owner can't see it.
409session_cost_limit_reachedThe session reached a spend limit. A soft limit can be continued from the session page.
429rate_limitedSee Rate limits.
502, 504upstream_error, upstream_timeoutA service Inspect depends on failed or timed out. Retry.