{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"Zapros API","version":"1.0.0","description":"OpenAI-compatible inference, scoped management APIs, and Agent Connect OAuth for MCP and Management REST. Prices and balances are denominated in Russian rubles (RUB). Inference keys start with zpr_; manually provisioned management tokens start with zpm_; short-lived OAuth access tokens start with zpo_. Dynamic-registration client IDs start with zpc_ and are public identifiers, not credentials. Every OAuth grant and token has exactly one audience: https://zapros.ai/mcp or https://zapros.ai/api/v1/management. Tokens for those resources are never interchangeable.","contact":{"url":"https://zapros.ai"}},"servers":[{"url":"https://zapros.ai","description":"Production"}],"tags":[{"name":"Models"},{"name":"Inference"},{"name":"Video"},{"name":"Management"},{"name":"OAuth"},{"name":"MCP"}],"paths":{"/api/v1/models":{"get":{"tags":["Models"],"operationId":"listChatModels","summary":"List chat and Responses models","security":[],"responses":{"200":{"description":"Current fail-closed model catalog and retail prices in RUB","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","required":["id","object","owned_by","pricing"],"properties":{"id":{"type":"string"},"object":{"const":"model"},"created":{"type":"integer"},"owned_by":{"type":"string"},"name":{"type":"string"},"modality":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string"}},"output_modalities":{"type":"array","items":{"type":"string"}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"context_length":{"type":["integer","null"]},"pricing":{"type":"object","required":["input_per_m","output_per_m"],"properties":{"input_per_m":{"type":"number","minimum":0},"output_per_m":{"type":"number","minimum":0},"request_rub_per_inference":{"type":"number","minimum":0},"image_rub_per_image_per_inference":{"type":["number","null"],"minimum":0},"web_search_rub_per_use":{"type":["number","null"],"minimum":0}}}},"additionalProperties":true}}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/embeddings/models":{"get":{"tags":["Models"],"operationId":"listEmbeddingModels","summary":"List embedding models","security":[],"responses":{"200":{"description":"Current fail-closed model catalog and retail prices in RUB","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","required":["id","object","owned_by","pricing"],"properties":{"id":{"type":"string"},"object":{"const":"model"},"created":{"type":"integer"},"owned_by":{"type":"string"},"name":{"type":"string"},"modality":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string"}},"output_modalities":{"type":"array","items":{"type":"string"}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"context_length":{"type":["integer","null"]},"pricing":{"type":"object","required":["input_per_m","output_per_m"],"properties":{"input_per_m":{"type":"number","minimum":0},"output_per_m":{"type":"number","minimum":0},"request_rub_per_inference":{"type":"number","minimum":0},"image_rub_per_image_per_inference":{"type":["number","null"],"minimum":0},"web_search_rub_per_use":{"type":["number","null"],"minimum":0}}}},"additionalProperties":true}}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/chat/completions":{"post":{"tags":["Inference"],"operationId":"createChatCompletion","summary":"Create an OpenAI-compatible chat completion","security":[{"InferenceApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string"},"models":{"type":"array","description":"Optional ordered fallback model IDs.","items":{"type":"string"}},"messages":{"type":"array","minItems":1,"items":{}},"max_tokens":{"type":"integer","minimum":1},"stream":{"type":"boolean","default":false},"tools":{"type":"array","items":{}}},"additionalProperties":true}}}},"responses":{"200":{"description":"Completion JSON or text/event-stream when stream=true","content":{"application/json":{"schema":{"type":"object"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"402":{"description":"Insufficient balance or key budget","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/responses":{"post":{"tags":["Inference"],"operationId":"createResponse","summary":"Create an OpenAI Responses-compatible response","security":[{"InferenceApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string"},"models":{"type":"array","items":{"type":"string"}},"input":{"oneOf":[{"type":"string","minLength":1},{"type":"array","minItems":1,"items":{}}]},"max_output_tokens":{"type":"integer","minimum":1},"stream":{"type":"boolean","default":false},"tools":{"type":"array","items":{}}},"additionalProperties":true}}}},"responses":{"200":{"description":"Response JSON or text/event-stream when stream=true","content":{"application/json":{"schema":{"type":"object"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"402":{"description":"Insufficient balance or key budget","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/embeddings":{"post":{"tags":["Inference"],"operationId":"createEmbedding","summary":"Create OpenAI-compatible text embeddings","security":[{"InferenceApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string"},"input":{"oneOf":[{"type":"string","minLength":1},{"type":"array","minItems":1,"maxItems":256,"items":{"type":"string","minLength":1}}]},"encoding_format":{"enum":["float","base64"]},"user":{"type":"string","minLength":1,"maxLength":255},"session_id":{"type":"string","minLength":1,"maxLength":255},"stream":{"const":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"Embedding list","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"402":{"description":"Insufficient balance or key budget","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/videos":{"get":{"tags":["Video","Models"],"operationId":"listVideoModels","summary":"List asynchronous video models and prices","security":[],"responses":{"200":{"description":"Video model catalog","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["Video"],"operationId":"createVideo","summary":"Start an asynchronous video generation","security":[{"InferenceApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","minLength":1,"maxLength":255},"prompt":{"type":"string","minLength":1,"maxLength":20000},"duration":{"type":"integer","minimum":1},"audio":{"type":"boolean"},"image_url":{"type":"string","format":"uri","pattern":"^https?://","minLength":1,"maxLength":8192}},"additionalProperties":false}}}},"responses":{"202":{"description":"Video job created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"402":{"description":"Insufficient balance or key budget","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/videos/{id}":{"get":{"tags":["Video"],"operationId":"getVideo","summary":"Get and refresh a video job","security":[{"InferenceApiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Video job state","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/account":{"get":{"tags":["Management"],"operationId":"getAccount","summary":"Get the account balance and identity","description":"Requires account:read. Accepts a manual zpm_ token or a zpo_ token bound to the Management API resource.","security":[{"ManagementOAuth":["account:read"]},{"ManagementToken":[]}],"x-zapros-required-scopes":["account:read"],"responses":{"200":{"description":"Account summary","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/projects":{"get":{"tags":["Management"],"operationId":"listManagementProjects","summary":"List personal projects available for inference keys","description":"Available with any key-management scope. Returns only personal projects whose inference usage can be charged to the authenticated account; agency wallets are not exposed until organization billing is enabled.","security":[{"ManagementOAuth":["keys:read"]},{"ManagementOAuth":["keys:create"]},{"ManagementOAuth":["keys:update"]},{"ManagementOAuth":["keys:revoke"]},{"ManagementToken":[]}],"x-zapros-any-scope":["keys:read","keys:create","keys:update","keys:revoke"],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","description":"Numeric cursor returned by the preceding page.","schema":{"type":"string","pattern":"^[0-9]+$"}}],"responses":{"200":{"description":"Bounded page of personal projects that can own inference keys","content":{"application/json":{"schema":{"type":"object","required":["object","data","next_cursor","total"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","required":["id","object","name","is_default","organization_id","organization_name","organization_kind","workspace_id","workspace_name","workspace_kind","workspace_is_default"],"properties":{"id":{"type":"string","minLength":1,"maxLength":191},"object":{"const":"project"},"name":{"type":"string"},"is_default":{"type":"boolean"},"organization_id":{"type":"string","minLength":1,"maxLength":191},"organization_name":{"type":"string"},"organization_kind":{"const":"personal"},"workspace_id":{"type":"string","minLength":1,"maxLength":191},"workspace_name":{"type":["string","null"]},"workspace_kind":{"enum":["internal","client"]},"workspace_is_default":{"type":"boolean"}},"additionalProperties":false}},"next_cursor":{"type":["string","null"],"pattern":"^[0-9]+$"},"total":{"type":"integer","minimum":0}},"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"409":{"description":"Stored personal tenancy is inconsistent","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"503":{"description":"Tenancy service is temporarily unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/projects/default":{"post":{"tags":["Management"],"operationId":"ensureManagementDefaultProject","summary":"Ensure the personal default project exists","description":"Requires keys:create. Idempotently creates or repairs the deterministic personal organization, workspace, wallet, and default project, then returns the project. Safe to repeat.","security":[{"ManagementOAuth":["keys:create"]},{"ManagementToken":[]}],"x-zapros-required-scopes":["keys:create"],"responses":{"200":{"description":"Existing or newly ensured default project","content":{"application/json":{"schema":{"type":"object","required":["id","object","name","is_default","organization_id","organization_name","organization_kind","workspace_id","workspace_name","workspace_kind","workspace_is_default"],"properties":{"id":{"type":"string","minLength":1,"maxLength":191},"object":{"const":"project"},"name":{"type":"string"},"is_default":{"type":"boolean"},"organization_id":{"type":"string","minLength":1,"maxLength":191},"organization_name":{"type":"string"},"organization_kind":{"const":"personal"},"workspace_id":{"type":"string","minLength":1,"maxLength":191},"workspace_name":{"type":["string","null"]},"workspace_kind":{"enum":["internal","client"]},"workspace_is_default":{"type":"boolean"}},"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"409":{"description":"Personal tenancy could not be created or repaired","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"503":{"description":"Tenancy service is temporarily unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/models":{"get":{"tags":["Management"],"operationId":"listManagementModels","summary":"List a bounded page of chat, embedding, or video models","description":"Requires models:read. Returns the same current catalog and retail RUB pricing used by the MCP list_models tool.","security":[{"ManagementOAuth":["models:read"]},{"ManagementToken":[]}],"x-zapros-required-scopes":["models:read"],"parameters":[{"name":"kind","in":"query","schema":{"enum":["all","chat","embedding","video"],"default":"all"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","description":"Numeric cursor returned by the preceding page.","schema":{"type":"string","pattern":"^[0-9]+$"}}],"responses":{"200":{"description":"Bounded model catalog page with current retail RUB pricing","content":{"application/json":{"schema":{"type":"object","required":["object","data","next_cursor","total"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","required":["id","object","kind","name","provider","pricing"],"properties":{"id":{"type":"string"},"object":{"const":"model"},"kind":{"enum":["chat","embedding","video"]},"name":{"type":"string"},"provider":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string"}},"output_modalities":{"type":"array","items":{"type":"string"}},"context_length":{"type":["integer","null"]},"mode":{"enum":["text","image"]},"durations":{"type":"array","items":{"type":"integer","minimum":1}},"supports_audio":{"type":"boolean"},"pricing":{"type":"object","required":["currency"],"properties":{"currency":{"const":"RUB"},"input_per_million_tokens":{"type":"number","minimum":0},"output_per_million_tokens":{"type":"number","minimum":0},"request_per_inference":{"type":"number","minimum":0},"image_per_input_per_inference":{"type":["number","null"],"minimum":0},"web_search_per_use":{"type":["number","null"],"minimum":0},"examples_by_duration":{"type":"object","additionalProperties":true}},"additionalProperties":false}},"additionalProperties":false}},"next_cursor":{"type":["string","null"],"pattern":"^[0-9]+$"},"total":{"type":"integer","minimum":0}},"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/cost-estimates":{"post":{"tags":["Management"],"operationId":"estimateManagementCost","summary":"Estimate bounded inference cost from the current catalog","description":"Requires models:read. Computes a retail RUB estimate without calling a provider, reserving balance, or charging the account. Actual accepted requests are settled from measured usage and may differ.","security":[{"ManagementOAuth":["models:read"]},{"ManagementToken":[]}],"x-zapros-required-scopes":["models:read"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","oneOf":[{"description":"input_tokens plus output_tokens must not exceed the selected model's context window.","required":["endpoint","model"],"properties":{"endpoint":{"const":"chat"},"model":{"type":"string","minLength":1,"maxLength":255},"input_tokens":{"type":"integer","minimum":0,"maximum":10000000},"output_tokens":{"type":"integer","minimum":0,"maximum":32768},"image_inputs":{"type":"integer","minimum":0,"maximum":4},"web_search_uses":{"type":"integer","minimum":0,"maximum":3},"web_search_engine":{"enum":["exa","parallel","perplexity"]}},"additionalProperties":false},{"description":"input_tokens plus output_tokens must not exceed the selected model's context window.","required":["endpoint","model"],"properties":{"endpoint":{"const":"responses"},"model":{"type":"string","minLength":1,"maxLength":255},"input_tokens":{"type":"integer","minimum":0,"maximum":10000000},"output_tokens":{"type":"integer","minimum":0,"maximum":32768},"image_inputs":{"type":"integer","minimum":0,"maximum":4},"web_search_uses":{"type":"integer","minimum":0,"maximum":3},"web_search_engine":{"enum":["exa","parallel","perplexity"]}},"additionalProperties":false},{"required":["endpoint","model"],"properties":{"endpoint":{"const":"embeddings"},"model":{"type":"string","minLength":1,"maxLength":255},"input_tokens":{"type":"integer","minimum":0,"maximum":10000000}},"additionalProperties":false},{"required":["endpoint","model"],"properties":{"endpoint":{"const":"videos"},"model":{"type":"string","minLength":1,"maxLength":255},"duration_seconds":{"type":"integer","minimum":1,"maximum":3600},"audio":{"type":"boolean"}},"additionalProperties":false}]}}}},"responses":{"200":{"description":"Catalog-based RUB estimate only; no provider call, reservation, or charge occurs","content":{"application/json":{"schema":{"type":"object","required":["object","currency","endpoint","model","estimated_cost_rub","assumptions","charged","disclaimer"],"properties":{"object":{"const":"cost_estimate"},"currency":{"const":"RUB"},"endpoint":{"enum":["chat","responses","embeddings","videos"]},"model":{"type":"string"},"estimated_cost_rub":{"type":"number","minimum":0},"breakdown":{"type":"object","additionalProperties":true},"assumptions":{"type":"object","additionalProperties":true},"charged":{"const":false},"disclaimer":{"type":"string"}},"additionalProperties":false}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"404":{"description":"Model not found or unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/keys":{"get":{"tags":["Management"],"operationId":"listApiKeys","summary":"List inference keys without revealing their secrets","description":"Requires keys:read and an explicit project_id. Manual zpm_ callers see keys in that authorized project; Management OAuth callers see only project keys created by that exact grant. Secrets are never listed.","security":[{"ManagementOAuth":["keys:read"]},{"ManagementToken":[]}],"x-zapros-required-scopes":["keys:read"],"parameters":[{"$ref":"#/components/parameters/ProjectId"}],"responses":{"200":{"description":"Inference key list","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}},"post":{"tags":["Management"],"operationId":"createApiKey","summary":"Create an inference key","description":"Requires keys:create and an explicit project_id in the request body. A manually provisioned zpm_ token receives the new zpr_ secret once when it creates through REST. A zpo_ token bound to the Management API never receives the raw zpr_ secret; it receives a short-lived owner-authenticated dashboard claim. If an MCP claim for the same zpm_ idempotent operation was already acknowledged or expired, REST replay returns that terminal claim metadata and never restores the erased secret. An explicit monthly budget, per-request cap, and non-empty model allowlist are required.","security":[{"ManagementOAuth":["keys:create"]},{"ManagementToken":[]}],"x-zapros-required-scopes":["keys:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":2,"properties":{"project_id":{"type":"string","minLength":1,"maxLength":191,"description":"Project that owns the inference key."},"name":{"type":"string","minLength":1,"maxLength":100},"monthlyBudgetRub":{"type":"number","minimum":0,"maximum":99999999.9999},"maxRequestRub":{"type":"number","exclusiveMinimum":0,"maximum":99999999.9999},"allowedModels":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","minLength":1,"maxLength":255},"description":"Management-token delegation requires a non-empty model allowlist."}},"additionalProperties":false,"required":["project_id","monthlyBudgetRub","maxRequestRub","allowedModels"]}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"8-128 visible ASCII characters. Reusing the same value with the same credential and body prevents duplicate creation for 24 hours. A one-time secret can be replayed only while it remains encrypted; acknowledging or expiring a dashboard claim permanently erases it.","schema":{"type":"string","minLength":8,"maxLength":128}}],"responses":{"201":{"description":"New key. A direct zpm_ REST creation receives a one-time raw secret. Management OAuth callers—and zpm_ replays whose same MCP claim is already terminal—receive dashboard-claim metadata without a raw secret.","headers":{"Idempotency-Replayed":{"description":"true when this safely replays a prior creation","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ApiKeyWithOneTimeSecret"},{"$ref":"#/components/schemas/DelegatedApiKeyClaim"}]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"409":{"description":"Idempotency conflict or account key-count limit reached","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/keys/{id}":{"patch":{"tags":["Management"],"operationId":"updateApiKey","summary":"Update an inference key's name or limits","description":"Requires keys:update and an explicit project_id in the request body. Manual zpm_ callers may update keys in that authorized project; Management OAuth callers may update only project keys created by that exact grant. Delegated updates cannot exceed the grant policy or remove mandatory limits.","security":[{"ManagementOAuth":["keys:update"]},{"ManagementToken":[]}],"x-zapros-required-scopes":["keys:update"],"parameters":[{"$ref":"#/components/parameters/ApiKeyId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":2,"properties":{"project_id":{"type":"string","minLength":1,"maxLength":191,"description":"Project that owns the inference key."},"name":{"type":"string","minLength":1,"maxLength":100},"monthlyBudgetRub":{"type":"number","minimum":0,"maximum":99999999.9999},"maxRequestRub":{"type":"number","exclusiveMinimum":0,"maximum":99999999.9999},"allowedModels":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","minLength":1,"maxLength":255},"description":"Management-token delegation requires a non-empty model allowlist."}},"additionalProperties":false,"required":["project_id"]}}}},"responses":{"200":{"description":"Updated key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"404":{"description":"Key not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}},"delete":{"tags":["Management"],"operationId":"revokeApiKey","summary":"Revoke an inference key","description":"Requires keys:revoke and an explicit project_id query parameter. Manual zpm_ callers may revoke keys in that authorized project; Management OAuth callers may revoke only project keys created by that exact grant. Revocation is idempotent.","security":[{"ManagementOAuth":["keys:revoke"]},{"ManagementToken":[]}],"x-zapros-required-scopes":["keys:revoke"],"parameters":[{"$ref":"#/components/parameters/ApiKeyId"},{"$ref":"#/components/parameters/ProjectId"}],"responses":{"200":{"description":"Revocation result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"404":{"description":"Key not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/usage":{"get":{"tags":["Management"],"operationId":"getUsage","summary":"Get bounded usage aggregates and recent requests","description":"Requires usage:read. Manual zpm_ callers receive account usage; Management OAuth callers receive only usage attributable to keys created by that exact grant.","security":[{"ManagementOAuth":["usage:read"]},{"ManagementToken":[]}],"x-zapros-required-scopes":["usage:read"],"parameters":[{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":365,"default":30}},{"name":"limit","in":"query","description":"Maximum number of recent request rows.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Usage summary","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/compute/offers":{"get":{"tags":["Management"],"operationId":"listComputeOffers","summary":"List compute offers","description":"Requires compute:read. The initial catalog may be empty until compute hosting is enabled.","security":[{"ManagementOAuth":["compute:read"]},{"ManagementToken":[]}],"x-zapros-required-scopes":["compute:read"],"responses":{"200":{"description":"Compute offer list","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/compute/instances":{"get":{"tags":["Management"],"operationId":"listComputeInstances","summary":"List account compute instances","description":"Requires compute:read. The initial list may be empty until compute hosting is enabled.","security":[{"ManagementOAuth":["compute:read"]},{"ManagementToken":[]}],"x-zapros-required-scopes":["compute:read"],"responses":{"200":{"description":"Compute instance list","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/tokens":{"get":{"tags":["Management"],"operationId":"listManagementTokens","summary":"List management tokens","description":"Dashboard-session only. Management tokens cannot create more management tokens.","security":[{"SecureSessionCookie":[]},{"SessionCookie":[]}],"responses":{"200":{"description":"Management token metadata; secrets are never returned","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}},"post":{"tags":["Management"],"operationId":"createManagementToken","summary":"Create a scoped management token","description":"Dashboard-session and exact same-Origin only. The zpm_ secret is returned once. This operation is intentionally unavailable through MCP.","security":[{"SecureSessionCookie":[]},{"SessionCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","scopes","expiresAt"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"type":"array","minItems":1,"uniqueItems":true,"items":{"enum":["account:read","keys:read","keys:create","keys:update","keys:revoke","usage:read","models:read","compute:read"]}},"expiresAt":{"type":["string","null"],"format":"date-time","description":"Future ISO 8601 timestamp no more than 366 days away, or explicit null for no expiry. At most 20 active and 100 total management tokens are allowed per account."}},"additionalProperties":false}}}},"responses":{"201":{"description":"New token, including its one-time secret","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"409":{"description":"Active or total management-token limit reached","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/tokens/{id}":{"delete":{"tags":["Management"],"operationId":"revokeManagementToken","summary":"Revoke a management token","description":"Dashboard-session and exact same-Origin only.","security":[{"SecureSessionCookie":[]},{"SessionCookie":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Revocation result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"404":{"description":"Management token not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/.well-known/oauth-protected-resource/mcp":{"get":{"tags":["OAuth"],"operationId":"getMcpProtectedResourceMetadata","summary":"Discover OAuth protection for the MCP resource","description":"RFC 9728 protected-resource metadata for the exact resource https://zapros.ai/mcp.","security":[],"responses":{"200":{"description":"Protected-resource metadata","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/.well-known/oauth-protected-resource/api/v1/management":{"get":{"tags":["OAuth"],"operationId":"getManagementProtectedResourceMetadata","summary":"Discover OAuth protection for the Management API resource","description":"RFC 9728 protected-resource metadata for the exact resource https://zapros.ai/api/v1/management.","security":[],"responses":{"200":{"description":"Protected-resource metadata","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"tags":["OAuth"],"operationId":"getOAuthAuthorizationServerMetadata","summary":"Discover Agent Connect authorization endpoints","description":"RFC 8414 authorization-server metadata. Zapros supports Client ID Metadata Documents and secretless Dynamic Client Registration for public clients, plus authorization_code, refresh_token, RFC 7009 token revocation, and S256 PKCE; client secrets are not accepted.","security":[],"responses":{"200":{"description":"Authorization-server metadata","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/oauth/authorize":{"get":{"tags":["OAuth"],"operationId":"authorizeAgentConnect","summary":"Start authorization-code consent","description":"Starts interactive consent for a public client. redirect_uri must exactly match the client metadata, resource must select exactly one supported audience, and code_challenge_method must be S256. MCP and Management API access require separate grants.","security":[],"parameters":[{"name":"response_type","in":"query","required":true,"schema":{"const":"code"}},{"name":"client_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string","format":"uri"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":1024}},{"name":"response_mode","in":"query","required":false,"schema":{"const":"query"}},{"name":"ui_locales","in":"query","required":false,"schema":{"type":"string","maxLength":128}},{"name":"resource","in":"query","required":true,"schema":{"enum":["https://zapros.ai/mcp","https://zapros.ai/api/v1/management"]}},{"name":"code_challenge","in":"query","required":true,"schema":{"type":"string","minLength":43,"maxLength":128}},{"name":"code_challenge_method","in":"query","required":true,"schema":{"const":"S256"}}],"responses":{"303":{"description":"Redirect to Zapros login or consent"},"400":{"description":"Invalid authorization request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Invalid client metadata","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"OAuth pre-authorization rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/oauth/register":{"post":{"tags":["OAuth"],"operationId":"registerAgentConnectClient","summary":"Dynamically register a public OAuth client","description":"Secretless Dynamic Client Registration for Agent Connect clients, including MCP clients such as Cursor and Management API integrations. Only authorization-code public clients using token_endpoint_auth_method=none are accepted. The JSON body is limited to 16 KiB; redirect URIs and requested scopes are strictly bounded. Standard optional descriptive fields are validated for client compatibility but may be omitted from storage and the response. Zapros never issues or accepts a client secret at this endpoint.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["redirect_uris"],"maxProperties":14,"properties":{"client_name":{"type":"string","minLength":1,"maxLength":191,"default":"MCP client"},"client_uri":{"type":"string","format":"uri","maxLength":2048,"description":"Optional public HTTPS homepage for the client."},"redirect_uris":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","format":"uri","maxLength":2048},"description":"Exact callback URIs. HTTPS is required except for HTTP loopback callbacks on localhost, *.localhost, 127.0.0.1, or ::1. Fragments and userinfo are rejected."},"token_endpoint_auth_method":{"const":"none","default":"none"},"grant_types":{"type":"array","minItems":1,"maxItems":2,"uniqueItems":true,"items":{"enum":["authorization_code","refresh_token"]},"contains":{"const":"authorization_code"},"minContains":1,"maxContains":1,"default":["authorization_code","refresh_token"],"description":"authorization_code is required; refresh_token is the only optional additional grant."},"response_types":{"type":"array","minItems":1,"maxItems":1,"uniqueItems":true,"items":{"const":"code"},"default":["code"]},"scope":{"type":"string","minLength":1,"maxLength":1024,"description":"Space-delimited subset of account:read, models:read, usage:read, compute:read, keys:read, keys:create, keys:update, and keys:revoke. Omission registers the full supported set; consent still bounds the resulting grant."},"application_type":{"enum":["native","web"]},"contacts":{"type":"array","maxItems":5,"items":{"type":"string","minLength":1,"maxLength":254}},"logo_uri":{"type":"string","format":"uri","maxLength":2048},"policy_uri":{"type":"string","format":"uri","maxLength":2048},"tos_uri":{"type":"string","format":"uri","maxLength":2048},"software_id":{"type":"string","minLength":1,"maxLength":191},"software_version":{"type":"string","minLength":1,"maxLength":64}},"additionalProperties":false}}}},"responses":{"201":{"description":"Registered public client metadata. The response is non-cacheable and contains no client secret.","headers":{"Cache-Control":{"description":"Always no-store.","schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DynamicClientRegistration"}}}},"400":{"description":"Invalid client metadata, unsupported scope, or redirect URI","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"413":{"description":"Registration body exceeds 16 KiB","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Dynamic registration rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/oauth/token":{"post":{"tags":["OAuth"],"operationId":"exchangeAgentConnectToken","summary":"Exchange an authorization code or rotate a refresh token","description":"Public-client token endpoint. Every request must bind exactly one resource: https://zapros.ai/mcp or https://zapros.ai/api/v1/management. The requested resource must exactly match the authorization code, refresh token, and grant; it cannot be switched during exchange. Access tokens use the zpo_ namespace and normally expire after 15 minutes. Every refresh exchanges the supplied refresh token for a new one; reuse revokes that grant.","security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"oneOf":[{"type":"object","required":["grant_type","client_id","resource","code","redirect_uri","code_verifier"],"properties":{"grant_type":{"const":"authorization_code"},"client_id":{"type":"string"},"resource":{"enum":["https://zapros.ai/mcp","https://zapros.ai/api/v1/management"]},"code":{"type":"string"},"redirect_uri":{"type":"string","format":"uri"},"code_verifier":{"type":"string","minLength":43,"maxLength":128}},"additionalProperties":false},{"type":"object","required":["grant_type","client_id","resource","refresh_token"],"properties":{"grant_type":{"const":"refresh_token"},"client_id":{"type":"string"},"resource":{"enum":["https://zapros.ai/mcp","https://zapros.ai/api/v1/management"]},"refresh_token":{"type":"string"},"scope":{"type":"string"}},"additionalProperties":false}]}}}},"responses":{"200":{"description":"Short-lived access token and rotated refresh token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenResponse"}}}},"400":{"description":"Invalid OAuth grant or request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Invalid public client","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"OAuth pre-authorization rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/oauth/revoke":{"post":{"tags":["OAuth"],"operationId":"revokeAgentConnectToken","summary":"Revoke an Agent Connect token and its grant","description":"RFC 7009 revocation for secretless public clients. The body is limited to 8 KiB and accepts only token, client_id, and an optional token_type_hint. An access or refresh token owned by the client revokes the entire grant, all of its tokens, and active inference keys created by that grant. Malformed or unsupported token values, unknown tokens, tokens owned by another valid client, and repeated requests all return the same empty 200 response after client validation.","security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["token","client_id"],"properties":{"token":{"type":"string","pattern":"^(?:zpo_[A-Za-z0-9_-]{48}|zprf_[A-Za-z0-9_-]{48})$","x-sensitive":true},"client_id":{"type":"string","minLength":1,"maxLength":512},"token_type_hint":{"enum":["access_token","refresh_token"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Empty, non-cacheable response for successful, invalid, unknown, wrong-client, or repeated revocation","headers":{"Cache-Control":{"description":"Always no-store.","schema":{"const":"no-store"}}}},"400":{"description":"Invalid revocation request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Invalid public client","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"413":{"description":"Revocation body exceeds 8 KiB","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"OAuth pre-authorization rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/oauth/grants":{"get":{"tags":["OAuth"],"operationId":"listConnectedApps","summary":"List connected OAuth applications","description":"Dashboard-session only; token secrets are never returned.","security":[{"SecureSessionCookie":[]},{"SessionCookie":[]}],"responses":{"200":{"description":"Connected applications and their scopes, policy, and status","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/oauth/grants/{id}":{"delete":{"tags":["OAuth"],"operationId":"revokeConnectedApp","summary":"Revoke a connected OAuth application","description":"Dashboard-session and exact same-Origin only. Revokes all access and refresh tokens and disables active inference keys created by this grant.","security":[{"SecureSessionCookie":[]},{"SessionCookie":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Revoked grant","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"404":{"description":"OAuth grant not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/api/v1/management/key-claims/{id}":{"post":{"tags":["Management","OAuth"],"operationId":"revealAgentCreatedApiKey","summary":"Reveal an agent-created inference-key secret","description":"Dashboard-session and exact same-Origin only. MCP never returns a raw zpr_ secret in model-facing output; it returns a 15-minute claim URL instead. Reveal is safely replayable by the signed-in owner until explicit acknowledgement or expiry.","security":[{"SecureSessionCookie":[]},{"SessionCookie":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Replayable owner-only zpr_ reveal","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"404":{"description":"Claim not found or no longer available","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"409":{"description":"Claim consumed or expired","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}},"delete":{"tags":["Management","OAuth"],"operationId":"acknowledgeAgentCreatedApiKey","summary":"Acknowledge that an inference-key secret was saved","description":"Dashboard-session and exact same-Origin only. After the owner confirms the revealed key was saved, acknowledgement atomically erases encrypted secret copies and leaves an idempotent consumed tombstone. Repeating acknowledgement is safe.","security":[{"SecureSessionCookie":[]},{"SessionCookie":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Claim acknowledged or terminal expiry acknowledged","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"403":{"description":"The credential lacks the required scope or policy access","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"404":{"description":"Claim not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"409":{"description":"Claim has not been revealed yet","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true}}}}}}},"/mcp":{"post":{"tags":["MCP"],"operationId":"mcp","summary":"Use the stateless Zapros MCP server","description":"Accepts either an Agent Connect zpo_ OAuth token for resource https://zapros.ai/mcp or a manually provisioned scoped zpm_ bearer token. OAuth clients discover RFC 9728 protected-resource metadata and RFC 8414 authorization-server metadata, then use authorization code with S256 PKCE. Supports MCP 2026-07-28 and safe compatibility with 2025-11-25 and 2025-06-18. Tool availability is scope-filtered. OAuth grants can manage only keys created by that same grant and stay within the aggregate consent budget, per-request cap, model allowlist, and maximum active-key count. create_api_key returns a 15-minute owner-only dashboard claim rather than a raw zpr_ secret; Reveal is replayable until explicit ACK. Payments and management-token creation are never exposed.","security":[{"AgentOAuth":[]},{"ManagementToken":[]}],"parameters":[{"name":"MCP-Protocol-Version","in":"header","required":false,"description":"Conditionally required on every MCP 2026-07-28 request; legacy initialize negotiates in-band.","schema":{"enum":["2026-07-28","2025-11-25","2025-06-18"]}},{"name":"Accept","in":"header","required":false,"description":"Conditionally required in MCP 2026-07-28 and must list both application/json and text/event-stream, although this stateless server returns JSON.","schema":{"type":"string","example":"application/json, text/event-stream"}},{"name":"Mcp-Method","in":"header","required":false,"description":"Conditionally required in MCP 2026-07-28 and must match body.method.","schema":{"type":"string"}},{"name":"Mcp-Name","in":"header","required":false,"description":"Conditionally required for tools/call in MCP 2026-07-28. Unsafe or non-ASCII names use the =?base64?...?= sentinel encoding.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}],"description":"Omit for a notification. Explicit null is invalid."},"method":{"type":"string","minLength":1,"maxLength":200},"params":{"type":"object","description":"For MCP 2026-07-28, _meta must contain io.modelcontextprotocol/protocolVersion=2026-07-28 and an io.modelcontextprotocol/clientCapabilities object.","additionalProperties":true}},"additionalProperties":true}}}},"responses":{"200":{"description":"JSON-RPC 2.0 response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["jsonrpc","id","result"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"result":{}},"additionalProperties":false},{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}},"additionalProperties":false}},"additionalProperties":false}]}}}},"202":{"description":"Notification accepted"},"400":{"description":"Invalid JSON-RPC or MCP envelope","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}},"additionalProperties":false}},"additionalProperties":false}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}},"additionalProperties":false}},"additionalProperties":false}}}},"403":{"description":"Origin rejected or scope denied","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}},"additionalProperties":false}},"additionalProperties":false}}}},"404":{"description":"Unknown modern MCP method","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}},"additionalProperties":false}},"additionalProperties":false}}}},"406":{"description":"Required Accept media types missing","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}},"additionalProperties":false}},"additionalProperties":false}}}},"413":{"description":"Request body is too large","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}},"additionalProperties":false}},"additionalProperties":false}}}},"415":{"description":"Content-Type must be application/json","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}},"additionalProperties":false}},"additionalProperties":false}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}},"additionalProperties":false}},"additionalProperties":false}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}},"additionalProperties":false}},"additionalProperties":false}}}}}}}},"components":{"securitySchemes":{"InferenceApiKey":{"type":"http","scheme":"bearer","bearerFormat":"zpr_...","description":"Inference key created in the dashboard or management API."},"ManagementToken":{"type":"http","scheme":"bearer","bearerFormat":"zpm_...","description":"Manually provisioned scoped management token. Accepted by management REST and MCP; never share it with an untrusted model or application."},"AgentOAuth":{"type":"oauth2","description":"Agent Connect public-client OAuth for the exact MCP resource https://zapros.ai/mcp. Its short-lived zpo_ tokens are accepted only by MCP, never by Management REST.","x-zapros-resource":"https://zapros.ai/mcp","x-zapros-protected-resource-metadata":"https://zapros.ai/.well-known/oauth-protected-resource/mcp","flows":{"authorizationCode":{"authorizationUrl":"https://zapros.ai/oauth/authorize","tokenUrl":"https://zapros.ai/oauth/token","scopes":{"account:read":"Read account identity and RUB balance","models:read":"Read catalogs and estimate inference cost","usage:read":"Read usage attributed to this connection","compute:read":"Read compute offers and instances","keys:read":"List keys created by this connection","keys:create":"Create bounded inference keys","keys:update":"Update keys created by this connection","keys:revoke":"Revoke keys created by this connection"}}}},"ManagementOAuth":{"type":"oauth2","description":"Public-client OAuth for the exact Management API resource https://zapros.ai/api/v1/management. Its short-lived zpo_ tokens are accepted only by Management REST, never by MCP. This is a separate grant and token family even when the same client also connects to MCP.","x-zapros-resource":"https://zapros.ai/api/v1/management","x-zapros-protected-resource-metadata":"https://zapros.ai/.well-known/oauth-protected-resource/api/v1/management","flows":{"authorizationCode":{"authorizationUrl":"https://zapros.ai/oauth/authorize","tokenUrl":"https://zapros.ai/oauth/token","scopes":{"account:read":"Read account identity and RUB balance","models:read":"Read catalogs and estimate inference cost","usage:read":"Read usage attributed to this grant","compute:read":"Read compute offers and account instances","keys:read":"List keys created by this grant","keys:create":"Create bounded inference keys","keys:update":"Update keys created by this grant","keys:revoke":"Revoke keys created by this grant"}}}},"SessionCookie":{"type":"apiKey","in":"cookie","name":"next-auth.session-token","description":"Interactive dashboard session cookie used on local HTTP."},"SecureSessionCookie":{"type":"apiKey","in":"cookie","name":"__Secure-next-auth.session-token","description":"Interactive dashboard session cookie used on production HTTPS."}},"parameters":{"ApiKeyId":{"name":"id","in":"path","required":true,"schema":{"type":"string"}},"ProjectId":{"name":"project_id","in":"query","required":true,"description":"Project that owns the inference key.","schema":{"type":"string","minLength":1,"maxLength":191}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"oneOf":[{"type":"string"},{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}},"additionalProperties":true}]},"code":{"type":"string"}},"additionalProperties":true},"JsonRpcError":{"type":"object","required":["jsonrpc","id","error"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"oneOf":[{"type":"string","maxLength":200},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"data":{}},"additionalProperties":false}},"additionalProperties":false},"ApiKeyLimits":{"type":"object","required":["monthly_budget_rub","max_request_rub","allowed_models"],"properties":{"monthly_budget_rub":{"type":["number","null"],"minimum":0,"maximum":99999999.9999},"max_request_rub":{"type":["number","null"],"exclusiveMinimum":0,"maximum":99999999.9999},"allowed_models":{"type":"array","maxItems":500,"items":{"type":"string","minLength":1,"maxLength":255},"description":"An empty array allows all currently supported models."}},"additionalProperties":false},"ManagementProject":{"type":"object","required":["id","object","name","is_default","organization_id","organization_name","organization_kind","workspace_id","workspace_name","workspace_kind","workspace_is_default"],"properties":{"id":{"type":"string","minLength":1,"maxLength":191},"object":{"const":"project"},"name":{"type":"string"},"is_default":{"type":"boolean"},"organization_id":{"type":"string","minLength":1,"maxLength":191},"organization_name":{"type":"string"},"organization_kind":{"const":"personal"},"workspace_id":{"type":"string","minLength":1,"maxLength":191},"workspace_name":{"type":["string","null"]},"workspace_kind":{"enum":["internal","client"]},"workspace_is_default":{"type":"boolean"}},"additionalProperties":false},"ApiKey":{"type":"object","required":["id","object","organization_id","workspace_id","project_id","prefix","name","active","limits"],"properties":{"id":{"type":"string"},"object":{"const":"api_key"},"organization_id":{"type":"string"},"workspace_id":{"type":"string"},"project_id":{"type":"string"},"prefix":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"limits":{"type":"object","required":["monthly_budget_rub","max_request_rub","allowed_models"],"properties":{"monthly_budget_rub":{"type":["number","null"],"minimum":0,"maximum":99999999.9999},"max_request_rub":{"type":["number","null"],"exclusiveMinimum":0,"maximum":99999999.9999},"allowed_models":{"type":"array","maxItems":500,"items":{"type":"string","minLength":1,"maxLength":255},"description":"An empty array allows all currently supported models."}},"additionalProperties":false},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"additionalProperties":true},"ApiKeyWithOneTimeSecret":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"type":"object","required":["key"],"properties":{"key":{"type":"string","pattern":"^zpr_[A-Za-z0-9_-]{48}$","x-sensitive":true,"description":"Returned once to a trusted zpm_ caller. Never returned to an OAuth caller."}}}]},"DelegatedApiKeyClaim":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"type":"object","description":"Dashboard claim delivery. Terminal consumed or expired metadata may also be returned to a zpm_ REST replay after the same operation was completed through MCP.","required":["idempotency_replayed","secret_delivery"],"properties":{"idempotency_replayed":{"type":"boolean"},"secret_delivery":{"type":"object","required":["method","claim_id","claim_url","claim_expires_at","state"],"properties":{"method":{"const":"dashboard_claim"},"claim_id":{"type":"string","pattern":"^zpc_[A-Za-z0-9_-]{43}$"},"claim_url":{"type":"string","format":"uri"},"claim_expires_at":{"type":"string","format":"date-time"},"state":{"enum":["available","revealed","consumed","expired"]}},"additionalProperties":false}},"not":{"required":["key"]}}]},"OAuthTokenResponse":{"type":"object","required":["access_token","token_type","expires_in","refresh_token","scope","resource"],"properties":{"access_token":{"type":"string","pattern":"^zpo_"},"token_type":{"const":"Bearer"},"expires_in":{"type":"integer","minimum":1,"maximum":900},"refresh_token":{"type":"string","pattern":"^zprf_"},"scope":{"type":"string"},"resource":{"enum":["https://zapros.ai/mcp","https://zapros.ai/api/v1/management"]}},"additionalProperties":false},"DynamicClientRegistration":{"type":"object","required":["client_id","client_id_issued_at","client_name","redirect_uris","token_endpoint_auth_method","grant_types","response_types","scope"],"properties":{"client_id":{"type":"string","pattern":"^zpc_[A-Za-z0-9_-]{43}$","description":"Opaque public client identifier. This value is not a credential or secret."},"client_id_issued_at":{"type":"integer","minimum":0},"client_name":{"type":"string","minLength":1,"maxLength":191},"client_uri":{"type":"string","format":"uri","maxLength":2048},"redirect_uris":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","format":"uri","maxLength":2048}},"token_endpoint_auth_method":{"const":"none"},"grant_types":{"type":"array","prefixItems":[{"const":"authorization_code"},{"const":"refresh_token"}],"minItems":2,"maxItems":2},"response_types":{"type":"array","prefixItems":[{"const":"code"}],"minItems":1,"maxItems":1},"scope":{"type":"string"}},"additionalProperties":false},"Model":{"type":"object","required":["id","object","owned_by","pricing"],"properties":{"id":{"type":"string"},"object":{"const":"model"},"created":{"type":"integer"},"owned_by":{"type":"string"},"name":{"type":"string"},"modality":{"type":"string"},"input_modalities":{"type":"array","items":{"type":"string"}},"output_modalities":{"type":"array","items":{"type":"string"}},"supported_endpoints":{"type":"array","items":{"type":"string"}},"context_length":{"type":["integer","null"]},"pricing":{"type":"object","required":["input_per_m","output_per_m"],"properties":{"input_per_m":{"type":"number","minimum":0},"output_per_m":{"type":"number","minimum":0},"request_rub_per_inference":{"type":"number","minimum":0},"image_rub_per_image_per_inference":{"type":["number","null"],"minimum":0},"web_search_rub_per_use":{"type":["number","null"],"minimum":0}}}},"additionalProperties":true}}}}