{"openapi":"3.1.0","info":{"title":"Ostra API","version":"1.0.0","summary":"TestRelic’s testing models: Ostra Decision (failure triage, test impact, selector survival) and Ostra Pro (chat, OpenAI and Anthropic compatible).","description":"Reference: https://docs.testrelic.ai/lores/api. MCP server: https://ostra.testrelic.ai/mcp (tools: ostra_triage_failure, ostra_select_impacted_tests, ostra_check_selector, ostra_pro_chat, ostra_list_models).","contact":{"name":"TestRelic","url":"https://testrelic.ai"}},"externalDocs":{"url":"https://docs.testrelic.ai/lores/api"},"servers":[{"url":"https://ostra.testrelic.ai/api/v1"}],"tags":[{"name":"Models","description":"The models your key can call."},{"name":"Ostra Decision","description":"Failure triage, test impact and selector survival."},{"name":"Ostra Pro","description":"The testing model: chat completions and messages."}],"paths":{"/models":{"get":{"operationId":"listModels","summary":"List models","description":"Lists the models your key can call, with their tasks, limits and prices.\n\nUse it to check a key works (any key, read-only included) and to read the live Ostra Decision release. It’s free and not rate limited.\n\n**Cost:** Free.","tags":["Models"],"security":[{"bearerAuth":[]}],"externalDocs":{"url":"https://docs.testrelic.ai/lores/api/models/list"},"responses":{"200":{"description":"200 · Models","headers":{"x-request-id":{"description":"Id of this request (`req_` + 26 characters). Quote it to support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","description":"Always `list`.","enum":["list"]},"data":{"type":"array","description":"One entry per model: Ostra Decision, then Ostra Pro.","items":{"type":"object","properties":{"id":{"type":"string","description":"Model id to send as `model`: `ostra-lite` (Ostra Decision) or `ostra-pro` (Ostra Pro)."},"name":{"type":"string","description":"Display name: `Ostra Decision` or `Ostra Pro`."},"status":{"type":"string","description":"Ostra Decision only: `beta`."},"release":{"type":"string","description":"Ostra Decision only: the live release, e.g. `v.beta.5`, or `unavailable` if it can’t be reached right now."},"tasks":{"type":"array","description":"Ostra Decision only: its three tasks.","items":{"type":"object","properties":{"task":{"type":"string","description":"Task id to send as `task`.","enum":["triage","test_impact","selector_survival"]},"name":{"type":"string","description":"Display name."},"description":{"type":"string","description":"What the task answers."},"mcpTool":{"type":"string","description":"The MCP tool that runs this task."},"rateLabel":{"type":"string","description":"Input price, e.g. `$0.50 / 1M failures`."},"outputRateLabel":{"type":"string","description":"Output price (always `$0.00`)."},"version":{"type":"string","description":"Version of this task’s model in the live release."},"contentHash":{"type":"string","description":"Content hash of that model."},"gatePassed":{"type":"boolean","description":"The model passed its release quality gate."},"classes":{"type":"array","description":"The classes the task can answer.","items":{"type":"string"}},"deferThreshold":{"type":"number","description":"The task’s default confidence bar for a firm answer. A class can use a different bar; each answer reports the one it used in `threshold`."}}}},"pricing":{"type":"object","description":"Human-readable prices: `input`, `output`, and for Ostra Pro `cached_input`.","additionalProperties":{"type":"string"}},"latencyP50Ms":{"type":["number","null"],"description":"Ostra Decision only: your workspace’s median latency over 7 days."},"requests7d":{"type":"integer","description":"Ostra Decision only: your workspace’s requests over 7 days."},"object":{"type":"string","description":"Ostra Pro only: `model`."},"created":{"type":"integer","description":"Ostra Pro only: Unix time the model version was released."},"owned_by":{"type":"string","description":"Ostra Pro only: `testrelic`."},"version":{"type":"string","description":"Ostra Pro only: `1.0`."},"base_url":{"type":"string","description":"Ostra Pro only: base URL for OpenAI-compatible clients."},"context_window":{"type":"integer","description":"Ostra Pro only: 262,144 tokens."},"max_output_tokens":{"type":"integer","description":"Ostra Pro only: 32,768 tokens."},"mcp_tool":{"type":"string","description":"Ostra Pro only: `ostra_pro_chat`."}}}}}},"examples":{"ok":{"summary":"200 · Models","value":{"object":"list","data":[{"id":"ostra-lite","name":"Ostra Decision","status":"beta","release":"v.beta.5","tasks":[{"task":"triage","name":"Failure triage","description":"Classifies a failing test as flaky, product bug, test bug, environment or selector drift.","mcpTool":"ostra_triage_failure","rateLabel":"$0.50 / 1M failures","outputRateLabel":"$0.00 / 1M decisions","version":"1.4.0","contentHash":"sha256:3f9a1c07d2e4b8a6","gatePassed":true,"classes":["flaky","product_bug","test_bug","environment","selector_drift"],"deferThreshold":0.6},{"task":"test_impact","name":"Test impact","description":"Ranks candidate tests by the probability that a diff breaks them.","mcpTool":"ostra_select_impacted_tests","rateLabel":"$2.00 / 1M diffs","outputRateLabel":"$0.00 / 1M decisions","version":"1.1.2","contentHash":"sha256:a07be3315c9d4f12","gatePassed":true,"classes":["not_impacted","impacted"],"deferThreshold":0.55},{"task":"selector_survival","name":"Selector survival","description":"Predicts whether UI locators survive the next release.","mcpTool":"ostra_check_selector","rateLabel":"$0.25 / 1M selectors","outputRateLabel":"$0.00 / 1M decisions","version":"1.2.0","contentHash":"sha256:5d21f0e9c4a7b3e8","gatePassed":true,"classes":["survives","breaks"],"deferThreshold":0.6}],"pricing":{"input":"$0.25–$2.00 / 1M inputs","output":"$0.00 / 1M decisions"},"latencyP50Ms":41,"requests7d":1284},{"id":"ostra-pro","object":"model","created":1794873600,"owned_by":"testrelic","name":"Ostra Pro","version":"1.0","base_url":"https://ostra.testrelic.ai/api/v1","context_window":262144,"max_output_tokens":32768,"pricing":{"input":"$0.64 / 1M input tokens","cached_input":"$0.06 / 1M cached input tokens","output":"$4.47 / 1M output tokens"},"mcp_tool":"ostra_pro_chat"}]}}}}}},"401":{"description":"`authentication_error`: The API key is missing, malformed, unknown, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`permission_error`: The caller’s IP isn’t in the key’s allowlist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/predict":{"post":{"operationId":"predict","summary":"Run a task","description":"Runs one Ostra Decision task (failure triage, test impact or selector survival) and returns its decision.\n\nSend `model: \"ostra-lite\"`, the `task`, and that task’s `input`. The answer is in `output`, in the shape for the task. An identical task and input within 24 hours is answered from cache, for free.\n\n**Cost:** Triage $0.50 per 1M failures; test impact $2.00 per 1M requests; selector survival $0.25 per 1M locators. Output is free. Cached answers and errors cost nothing; a `defer` answer is billed.","tags":["Ostra Decision"],"security":[{"bearerAuth":[]}],"externalDocs":{"url":"https://docs.testrelic.ai/lores/api/decision/predict"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Always `ostra-lite` (Ostra Decision).","enum":["ostra-lite"]},"task":{"type":"string","description":"Which task to run.","enum":["triage","test_impact","selector_survival"]},"input":{"description":"The task input. Shape depends on `task`.","oneOf":[{"title":"triage","type":"object","properties":{"test_id":{"type":"string","description":"Your identifier for the failing test, echoed back in the answer. Use a stable name, e.g. `checkout.spec.ts > applies coupon`.","minLength":1,"maxLength":512},"run_id":{"type":"string","description":"Your identifier for the CI run, echoed back.","minLength":1,"maxLength":512},"context":{"type":"object","description":"Evidence about the failure. Every field is optional except that `error_class` or `error_message` must be present. Missing evidence is treated as missing, never as zero, so send what you have.","properties":{"id":{"type":"string","description":"Your own id for this failure record.","minLength":1,"maxLength":512},"framework":{"type":"string","description":"Test framework that produced the failure.","enum":["playwright","cypress","jest","selenium"]},"capture_level":{"type":"string","description":"How much of the failure was captured (trace, DOM, network): `full`, `partial` or `none`.","enum":["full","partial","none"]},"error_class":{"type":"string","description":"Normalized class of the error. Required unless you send `error_message`.","enum":["timeout","locator_not_found","stale_element","strict_mode_violation","assertion_mismatch","network_error","script_error","unmapped"]},"error_message":{"type":"string","description":"The raw error text. Used only to derive `error_class` when you don’t send one; the answer reports which you used in `error_class_source`.","maxLength":8000},"action":{"type":"string","description":"The step that failed.","enum":["click","fill","navigate","assert","wait_for","api_call","screenshot"]},"locator":{"type":"object","description":"The locator the failing step used.","properties":{"strategy":{"type":"string","description":"How the element was located.","enum":["css","xpath","test_id","text","role","none"]}}},"diff":{"type":"object","description":"The code change the run tested.","properties":{"files_changed":{"type":"integer","description":"Files changed in the commit or pull request under test.","minimum":0,"maximum":1000000},"lines_added":{"type":"integer","description":"Lines added.","minimum":0,"maximum":1000000},"lines_removed":{"type":"integer","description":"Lines removed.","minimum":0,"maximum":1000000},"touches_test_file":{"type":"boolean","description":"The change edits a test file."},"touches_selector_file":{"type":"boolean","description":"The change edits a page object, locator map or other file that defines selectors."},"locator_values_removed":{"type":"boolean","description":"The change removes or renames a locator value (an id, test id, class or text) that the test uses."}}},"dom":{"type":"object","description":"What the page looked like at failure time.","properties":{"locator_found":{"type":"boolean","description":"The locator still matched an element in the captured DOM."}}},"memory":{"type":"object","description":"This test’s recent history, over its last 50 runs at most.","properties":{"runs_50":{"type":"integer","description":"Runs in the window.","minimum":0,"maximum":50},"failed_count_50":{"type":"integer","description":"Failed runs in the window.","minimum":0,"maximum":50},"passed_on_retry_50":{"type":"integer","description":"Runs that failed and then passed on retry.","minimum":0,"maximum":50},"consecutive_failures_50":{"type":"integer","description":"Failures in a row up to this one.","minimum":0,"maximum":50},"flake_rate_50":{"type":"number","description":"Share of runs in the window that were flaky, 0–1.","minimum":0,"maximum":1},"signature_repeat_count":{"type":"integer","description":"How many times this exact error signature has been seen before.","minimum":0,"maximum":1000000}}}}}},"required":["context"],"additionalProperties":false},{"title":"test_impact","type":"object","properties":{"diff":{"type":"object","description":"The code change to evaluate.","properties":{"files_changed":{"type":"integer","description":"Files changed in the commit or pull request under test.","minimum":0,"maximum":1000000},"lines_added":{"type":"integer","description":"Lines added.","minimum":0,"maximum":1000000},"lines_removed":{"type":"integer","description":"Lines removed.","minimum":0,"maximum":1000000},"touches_test_file":{"type":"boolean","description":"The change edits a test file."},"touches_selector_file":{"type":"boolean","description":"The change edits a page object, locator map or other file that defines selectors."}}},"candidates":{"type":"array","description":"The tests that could be affected. One request is billed once, whatever the number of candidates.","minItems":1,"maxItems":2000,"items":{"type":"object","properties":{"test_id":{"type":"string","description":"Your identifier for the test.","minLength":1,"maxLength":512},"co_change_rate":{"type":"number","description":"How often this test’s files change together with the changed files, 0–1.","minimum":0,"maximum":1},"historical_fail_rate":{"type":"number","description":"The test’s historical failure rate, 0–1.","minimum":0,"maximum":1}},"required":["test_id"]}}},"required":["diff","candidates"],"additionalProperties":false},{"title":"selector_survival","type":"object","properties":{"locators":{"type":"array","description":"The locators to check. Billed per locator.","minItems":1,"maxItems":500,"items":{"type":"object","properties":{"locator_id":{"type":"string","description":"Your identifier for the locator, echoed back.","minLength":1,"maxLength":512},"strategy":{"type":"string","description":"How the locator finds its element.","enum":["css","xpath","test_id","text","role","none"]},"dom_locator_found":{"type":"boolean","description":"The locator matches an element in the current build’s DOM."},"history":{"type":"array","description":"How well the locator resolved in past releases, oldest first.","maxItems":100,"items":{"type":"object","properties":{"release":{"type":"string","description":"Release label, e.g. `2026.11.1`.","minLength":1,"maxLength":128},"resolve_rate":{"type":"number","description":"Share of runs in that release where the locator resolved, 0–1.","minimum":0,"maximum":1}},"required":["release"]}}}}}},"required":["locators"],"additionalProperties":false}]}},"required":["model","task","input"]},"examples":{"triage":{"summary":"Failure triage","value":{"model":"ostra-lite","task":"triage","input":{"test_id":"checkout.spec.ts > applies coupon","run_id":"gha-18241","context":{"framework":"playwright","capture_level":"full","error_message":"TimeoutError: locator.click: Timeout 30000ms exceeded.\n  waiting for locator('#apply-coupon')","action":"click","locator":{"strategy":"css"},"diff":{"files_changed":3,"lines_added":41,"lines_removed":12,"touches_test_file":false,"touches_selector_file":false,"locator_values_removed":false},"dom":{"locator_found":true},"memory":{"runs_50":40,"flake_rate_50":0.15,"failed_count_50":6,"signature_repeat_count":5}}}}},"test_impact":{"summary":"Test impact","value":{"model":"ostra-lite","task":"test_impact","input":{"diff":{"files_changed":2,"lines_added":87,"lines_removed":14,"touches_test_file":false,"touches_selector_file":false},"candidates":[{"test_id":"checkout.spec.ts > applies coupon","co_change_rate":0.62,"historical_fail_rate":0.08},{"test_id":"checkout.spec.ts > rejects expired coupon","co_change_rate":0.58,"historical_fail_rate":0.03},{"test_id":"search.spec.ts > filters by brand","co_change_rate":0.02,"historical_fail_rate":0.04}]}}},"selector_survival":{"summary":"Selector survival","value":{"model":"ostra-lite","task":"selector_survival","input":{"locators":[{"locator_id":"checkout.apply-coupon","strategy":"css","dom_locator_found":true,"history":[{"release":"2026.10.1","resolve_rate":1},{"release":"2026.10.2","resolve_rate":0.92},{"release":"2026.11.1","resolve_rate":0.71}]},{"locator_id":"nav.account-menu","strategy":"role","dom_locator_found":true,"history":[{"release":"2026.10.2","resolve_rate":1},{"release":"2026.11.1","resolve_rate":1}]}]}}}}}}},"responses":{"200":{"description":"200 · Failure triage; 200 · Test impact; 200 · Selector survival","headers":{"x-request-id":{"description":"Id of this request (`req_` + 26 characters). Quote it to support.","schema":{"type":"string"}},"ostra-ratelimit-requests-limit":{"description":"Your workspace’s requests-per-minute limit.","schema":{"type":"integer"}},"ostra-ratelimit-requests-remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"ostra-ratelimit-requests-reset":{"description":"Seconds until the current minute ends and the count resets.","schema":{"type":"integer"}},"ostra-balance-remaining-usd":{"description":"Workspace credit balance after this request, in USD. Approximate under concurrent requests.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Request id, the same as the `x-request-id` header."},"model":{"type":"string","description":"The model and release that answered, e.g. `ostra-lite@v.beta.5`."},"task":{"type":"string","description":"The task you ran."},"cached":{"type":"boolean","description":"`true` when the answer came from the 24-hour cache (and cost nothing)."},"billed":{"type":"object","description":"What this request cost. Cached answers cost 0.","properties":{"units":{"type":"integer","description":"Billable units: 1 per failure (triage), 1 per request (test impact), 1 per locator (selector survival). 0 for a cached answer."},"costNano":{"type":"integer","description":"Cost in nano-dollars (1 USD = 1,000,000,000)."},"costUsd":{"type":"string","description":"Cost in USD as an exact decimal string, e.g. `\"0.0000005\"`."}}},"output":{"type":"object","description":"The task’s answer. Shapes: triage, test impact and selector survival below."}}},"examples":{"triage":{"summary":"200 · Failure triage","value":{"id":"req_01JDXK4M7Q2N8R5T6V9W3Y1Z0A","model":"ostra-lite@v.beta.5","task":"triage","cached":false,"billed":{"units":1,"costNano":500,"costUsd":"0.0000005"},"output":{"decision_id":"dec_5b0c9e2a7f3d4e18a6b2c9d0e1f4a7b3","task":"triage","decision":"flaky","value":"flaky","p":0.83,"probabilities":{"flaky":0.83,"product_bug":0.06,"test_bug":0.05,"environment":0.04,"selector_drift":0.02},"threshold":0.6,"defer_reason":null,"decided_by":"model","rule":null,"model":{"release":"v.beta.5","version":"1.4.0","content_hash":"sha256:3f9a1c07d2e4b8a6","gate_passed":true},"test_id":"checkout.spec.ts > applies coupon","run_id":"gha-18241","error_class":"timeout","error_class_source":"error_message"}}},"test_impact":{"summary":"200 · Test impact","value":{"id":"req_01JDXK5A1B2C3D4E5F6G7H8J9K","model":"ostra-lite@v.beta.5","task":"test_impact","cached":false,"billed":{"units":1,"costNano":2000,"costUsd":"0.000002"},"output":{"decisions":[{"decision_id":"dec_1a2b3c4d5e6f708192a3b4c5d6e7f809","task":"test_impact","decision":"impacted","value":"impacted","p":0.91,"probabilities":{"impacted":0.91,"not_impacted":0.09},"threshold":0.55,"defer_reason":null,"decided_by":"model","rule":null,"model":{"release":"v.beta.5","version":"1.1.2","content_hash":"sha256:a07be3315c9d4f12","gate_passed":true},"test_id":"checkout.spec.ts > applies coupon"},{"decision_id":"dec_2b3c4d5e6f708192a3b4c5d6e7f8091a","task":"test_impact","decision":"impacted","value":"impacted","p":0.86,"probabilities":{"impacted":0.86,"not_impacted":0.14},"threshold":0.55,"defer_reason":null,"decided_by":"model","rule":null,"model":{"release":"v.beta.5","version":"1.1.2","content_hash":"sha256:a07be3315c9d4f12","gate_passed":true},"test_id":"checkout.spec.ts > rejects expired coupon"},{"decision_id":"dec_3c4d5e6f708192a3b4c5d6e7f8091a2b","task":"test_impact","decision":"not_impacted","value":"not_impacted","p":0.97,"probabilities":{"impacted":0.03,"not_impacted":0.97},"threshold":0.55,"defer_reason":null,"decided_by":"model","rule":null,"model":{"release":"v.beta.5","version":"1.1.2","content_hash":"sha256:a07be3315c9d4f12","gate_passed":true},"test_id":"search.spec.ts > filters by brand"}],"impacted":["checkout.spec.ts > applies coupon","checkout.spec.ts > rejects expired coupon"],"selection":"model"}}},"selector_survival":{"summary":"200 · Selector survival","value":{"id":"req_01JDXK6P7Q8R9S0T1U2V3W4X5Y","model":"ostra-lite@v.beta.5","task":"selector_survival","cached":false,"billed":{"units":2,"costNano":500,"costUsd":"0.0000005"},"output":{"decisions":[{"decision_id":"dec_4d5e6f708192a3b4c5d6e7f8091a2b3c","task":"selector_survival","decision":"breaks","value":"breaks","p":0.78,"probabilities":{"survives":0.22,"breaks":0.78},"threshold":0.6,"defer_reason":null,"decided_by":"model","rule":null,"model":{"release":"v.beta.5","version":"1.2.0","content_hash":"sha256:5d21f0e9c4a7b3e8","gate_passed":true},"locator_id":"checkout.apply-coupon"},{"decision_id":"dec_5e6f708192a3b4c5d6e7f8091a2b3c4d","task":"selector_survival","decision":"survives","value":"survives","p":0.96,"probabilities":{"survives":0.96,"breaks":0.04},"threshold":0.6,"defer_reason":null,"decided_by":"model","rule":null,"model":{"release":"v.beta.5","version":"1.2.0","content_hash":"sha256:5d21f0e9c4a7b3e8","gate_passed":true},"locator_id":"nav.account-menu"}]}}}}}}},"400":{"description":"`invalid_request`: The body isn’t valid JSON or fails validation; `param` names the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`authentication_error`: The API key is missing, malformed, unknown, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`insufficient_balance`: Your credit balance doesn’t cover the request. Nothing is charged. `spend_limit_reached`: The workspace’s monthly spend limit (`scope: \"org\"`) or this key’s monthly spend cap (`scope: \"key\"`) is reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`permission_error`: The caller’s IP isn’t in the key’s allowlist, or a read-only key called a route that needs full access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`payload_too_large`: The request body is larger than the route allows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limit_exceeded`: The workspace’s requests-per-minute limit is reached. Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`upstream_error`: Ostra Decision failed to answer. Nothing was charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`service_unavailable`: Too many requests are updating the workspace balance at once. Nothing was charged; retry after `Retry-After` (1 s).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"`upstream_timeout`: Ostra Decision didn’t answer within 10 seconds. Nothing was charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/batch":{"post":{"operationId":"batch","summary":"Run a batch","description":"Runs up to 100 Ostra Decision tasks in one request, mixed tasks allowed, at half the price.\n\nEach item is answered independently: one bad item fails on its own and the rest still answer. Results come back in input order, with your `custom_id`. Items run 8 at a time with a 25-second deadline for the whole batch; items that don’t start in time fail with `upstream_timeout` and are refunded.\n\n**Cost:** Each item costs half its `/predict` price (rounded up to the nano-dollar). Failed and cached items are free. If the balance can’t cover the whole batch, the whole batch is refused with 402.","tags":["Ostra Decision"],"security":[{"bearerAuth":[]}],"externalDocs":{"url":"https://docs.testrelic.ai/lores/api/decision/batch"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Always `ostra-lite`.","enum":["ostra-lite"]},"items":{"type":"array","description":"The tasks to run. Each item counts as one request against your rate limit.","minItems":1,"maxItems":100,"items":{"type":"object","properties":{"custom_id":{"type":"string","description":"Your id for the item, echoed in its result. Longer values are cut to 128 characters.","maxLength":128},"task":{"type":"string","description":"Which task to run.","enum":["triage","test_impact","selector_survival"]},"input":{"type":"object","description":"The task’s input, as for `/predict`."}},"required":["task","input"]}}},"required":["model","items"]},"examples":{"mixed":{"summary":"Two triage items and a selector check","value":{"model":"ostra-lite","items":[{"custom_id":"checkout-applies-coupon","task":"triage","input":{"test_id":"checkout.spec.ts > applies coupon","run_id":"gha-18241","context":{"framework":"playwright","capture_level":"full","error_message":"TimeoutError: locator.click: Timeout 30000ms exceeded.\n  waiting for locator('#apply-coupon')","action":"click","locator":{"strategy":"css"},"diff":{"files_changed":3,"lines_added":41,"lines_removed":12,"touches_test_file":false,"touches_selector_file":false,"locator_values_removed":false},"dom":{"locator_found":true},"memory":{"runs_50":40,"flake_rate_50":0.15,"failed_count_50":6,"signature_repeat_count":5}}}},{"custom_id":"orders-lists-orders","task":"triage","input":{"test_id":"orders.api.spec.ts > lists orders","context":{"framework":"jest","error_message":"Error: Request failed with status code 503 (Service Unavailable) GET /api/orders","action":"api_call"}}},{"custom_id":"coupon-locators","task":"selector_survival","input":{"locators":[{"locator_id":"checkout.apply-coupon","strategy":"css","dom_locator_found":true,"history":[{"release":"2026.10.1","resolve_rate":1},{"release":"2026.10.2","resolve_rate":0.92},{"release":"2026.11.1","resolve_rate":0.71}]},{"locator_id":"nav.account-menu","strategy":"role","dom_locator_found":true,"history":[{"release":"2026.10.2","resolve_rate":1},{"release":"2026.11.1","resolve_rate":1}]}]}}]}}}}}},"responses":{"200":{"description":"200 · Results","headers":{"x-request-id":{"description":"Id of this request (`req_` + 26 characters). Quote it to support.","schema":{"type":"string"}},"ostra-ratelimit-requests-limit":{"description":"Your workspace’s requests-per-minute limit.","schema":{"type":"integer"}},"ostra-ratelimit-requests-remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"ostra-ratelimit-requests-reset":{"description":"Seconds until the current minute ends and the count resets.","schema":{"type":"integer"}},"ostra-balance-remaining-usd":{"description":"Workspace credit balance after this request, in USD. Approximate under concurrent requests.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Request id."},"model":{"type":"string","description":"The model and release that answered."},"billed":{"type":"object","description":"What this request cost. Cached answers cost 0.","properties":{"units":{"type":"integer","description":"Billable units: 1 per failure (triage), 1 per request (test impact), 1 per locator (selector survival). 0 for a cached answer."},"costNano":{"type":"integer","description":"Cost in nano-dollars (1 USD = 1,000,000,000)."},"costUsd":{"type":"string","description":"Cost in USD as an exact decimal string, e.g. `\"0.0000005\"`."}}},"results":{"type":"array","description":"One result per item, in input order.","items":{"type":"object","properties":{"custom_id":{"type":"string","description":"Your `custom_id`, when you sent one."},"ok":{"type":"boolean","description":"`true` when the item answered."},"task":{"type":"string","description":"The item’s task."},"cached":{"type":"boolean","description":"When `ok`: the answer came from cache."},"output":{"type":"object","description":"When `ok`: the task’s answer, as for `/predict`."},"error":{"type":"object","description":"When not `ok`: `{ \"type\", \"message\" }`.","properties":{"type":{"type":"string","description":"Error type, e.g. `invalid_request` or `upstream_error`."},"message":{"type":"string","description":"What went wrong."}}}}}}}},"examples":{"ok":{"summary":"200 · Results","value":{"id":"req_01JDXK7Z8Y7X6W5V4U3T2S1R0Q","model":"ostra-lite@v.beta.5","billed":{"units":4,"costNano":750,"costUsd":"0.00000075"},"results":[{"custom_id":"checkout-applies-coupon","ok":true,"task":"triage","cached":false,"output":{"decision_id":"dec_5b0c9e2a7f3d4e18a6b2c9d0e1f4a7b3","task":"triage","decision":"flaky","value":"flaky","p":0.83,"probabilities":{"flaky":0.83,"product_bug":0.06,"test_bug":0.05,"environment":0.04,"selector_drift":0.02},"threshold":0.6,"defer_reason":null,"decided_by":"model","rule":null,"model":{"release":"v.beta.5","version":"1.4.0","content_hash":"sha256:3f9a1c07d2e4b8a6","gate_passed":true},"test_id":"checkout.spec.ts > applies coupon","run_id":"gha-18241","error_class":"timeout","error_class_source":"error_message"}},{"custom_id":"orders-lists-orders","ok":true,"task":"triage","cached":false,"output":{"decision_id":"dec_6f708192a3b4c5d6e7f8091a2b3c4d5e","task":"triage","decision":"environment","value":"environment","p":0.74,"probabilities":{"flaky":0.12,"product_bug":0.08,"test_bug":0.03,"environment":0.74,"selector_drift":0.03},"threshold":0.6,"defer_reason":null,"decided_by":"model","rule":null,"model":{"release":"v.beta.5","version":"1.4.0","content_hash":"sha256:3f9a1c07d2e4b8a6","gate_passed":true},"test_id":"orders.api.spec.ts > lists orders","run_id":null,"error_class":"network_error","error_class_source":"error_message"}},{"custom_id":"coupon-locators","ok":true,"task":"selector_survival","cached":false,"output":{"decisions":[{"decision_id":"dec_4d5e6f708192a3b4c5d6e7f8091a2b3c","task":"selector_survival","decision":"breaks","value":"breaks","p":0.78,"probabilities":{"survives":0.22,"breaks":0.78},"threshold":0.6,"defer_reason":null,"decided_by":"model","rule":null,"model":{"release":"v.beta.5","version":"1.2.0","content_hash":"sha256:5d21f0e9c4a7b3e8","gate_passed":true},"locator_id":"checkout.apply-coupon"},{"decision_id":"dec_5e6f708192a3b4c5d6e7f8091a2b3c4d","task":"selector_survival","decision":"survives","value":"survives","p":0.96,"probabilities":{"survives":0.96,"breaks":0.04},"threshold":0.6,"defer_reason":null,"decided_by":"model","rule":null,"model":{"release":"v.beta.5","version":"1.2.0","content_hash":"sha256:5d21f0e9c4a7b3e8","gate_passed":true},"locator_id":"nav.account-menu"}]}}]}}}}}},"400":{"description":"`invalid_request`: `items` is missing, empty, or longer than 100. Per-item problems come back inside `results` instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`authentication_error`: The API key is missing, malformed, unknown, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`insufficient_balance`: Your credit balance doesn’t cover the request. Nothing is charged. `spend_limit_reached`: The workspace’s monthly spend limit (`scope: \"org\"`) or this key’s monthly spend cap (`scope: \"key\"`) is reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`permission_error`: The caller’s IP isn’t in the key’s allowlist, or a read-only key called a route that needs full access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`payload_too_large`: The body is larger than 2 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limit_exceeded`: The workspace’s requests-per-minute limit is reached. Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`service_unavailable`: Too many requests are updating the workspace balance at once. Nothing was charged; retry after `Retry-After` (1 s).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/chat/completions":{"post":{"operationId":"chatCompletions","summary":"Create a chat completion","description":"Sends a conversation to Ostra Pro and returns its reply. OpenAI Chat Completions compatible, streamed or not.\n\nAny OpenAI client works: set its base URL to `https://ostra.testrelic.ai/api/v1` and its API key to your Ostra key. Thinking is on by default; set its depth with `reasoning_effort`, or turn it off with `chat_template_kwargs.enable_thinking: false`.\n\nFields not listed below (for example `top_p`, `stop`, `seed`, `response_format`, `tool_choice`) are passed to the model unchanged.\n\n**Cost:** Input $0.64, cached input $0.06, output $4.47 per 1M tokens; reasoning tokens bill as output. The most a request can cost is held from your balance up front and the rest is refunded when it ends. Failed requests and cold-start timeouts cost nothing; a stream that breaks bills only the tokens produced.","tags":["Ostra Pro"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"externalDocs":{"url":"https://docs.testrelic.ai/lores/api/pro/chat-completions"},"parameters":[{"name":"x-ostra-session","in":"header","required":false,"description":"Optional. One value per conversation or agent run (1–128 letters, digits, `_`, `.`, `:` or `-`). Requests with the same value are routed to the same model replica when possible, so more of the conversation’s earlier turns are served from the prompt cache and bill as cached input. Best effort: an unknown value or a different replica just means no cache hit. See [Sessions and caching](https://docs.testrelic.ai/lores/api/sessions-and-caching).","schema":{"type":"string","pattern":"^[\\w.:-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Always `ostra-pro`.","enum":["ostra-pro"]},"messages":{"type":"array","description":"The conversation so far. Up to 8 images and 1 video per request.","minItems":1,"maxItems":4000,"items":{"type":"object","properties":{"role":{"type":"string","description":"Who wrote the message.","enum":["system","developer","user","assistant","tool"]},"content":{"description":"Text, or an array of parts: `{ \"type\": \"text\", \"text\" }`, `{ \"type\": \"image_url\", \"image_url\": { \"url\" } }` (https or `data:image/...;base64,` URL) or `{ \"type\": \"video_url\", \"video_url\": { \"url\" } }`."},"tool_calls":{"type":"array","description":"On `assistant` messages: the tool calls the model made, sent back as you received them.","items":{"type":"object"}},"tool_call_id":{"type":"string","description":"On `tool` messages: the id of the call this message answers."},"name":{"type":"string","description":"Optional participant name."}},"required":["role"]}},"max_completion_tokens":{"type":"integer","description":"Most output tokens to generate, reasoning included. Values above 32,768 are lowered to 32,768. Takes precedence over `max_tokens`.","default":8192,"minimum":1},"max_tokens":{"type":"integer","description":"Same as `max_completion_tokens` (older name).","default":8192,"minimum":1},"stream":{"type":"boolean","description":"Stream the reply as server-sent events. See [Streaming](https://docs.testrelic.ai/lores/api/streaming).","default":false},"stream_options":{"type":"object","description":"With `stream`. Set `include_usage: true` to get a final chunk with token usage.","properties":{"include_usage":{"type":"boolean","description":"Send a usage-only chunk before `[DONE]`."}}},"reasoning_effort":{"type":"string","description":"How long the model thinks before answering. Lower is faster and cheaper.","enum":["low","medium","xhigh"],"default":"xhigh"},"chat_template_kwargs":{"type":"object","description":"Model template switches.","properties":{"enable_thinking":{"type":"boolean","description":"`false` answers directly, with no reasoning.","default":true}}},"tools":{"type":"array","description":"Functions the model may call, in OpenAI format.","maxItems":128,"items":{"type":"object","properties":{"type":{"type":"string","description":"Always `function`.","enum":["function"]},"function":{"type":"object","description":"`{ \"name\", \"description\", \"parameters\" }`, where `parameters` is a JSON Schema."}},"required":["type","function"]}},"tool_choice":{"description":"`auto` (default), `none`, `required`, or a specific function, as in OpenAI."},"temperature":{"type":"number","description":"Sampling temperature.","minimum":0,"maximum":2},"n":{"type":"integer","description":"Only `1` is supported.","enum":[1]}},"required":["model","messages"]},"examples":{"basic":{"summary":"Ask a question","value":{"model":"ostra-pro","messages":[{"role":"system","content":"You are a senior test engineer. Answer briefly."},{"role":"user","content":"This Playwright test times out on CI but passes locally. Why, and how do I fix it?"}],"reasoning_effort":"low","max_tokens":1024}},"stream":{"summary":"Stream the reply","value":{"model":"ostra-pro","messages":[{"role":"system","content":"You are a senior test engineer. Answer briefly."},{"role":"user","content":"This Playwright test times out on CI but passes locally. Why, and how do I fix it?"}],"reasoning_effort":"low","max_tokens":1024,"stream":true,"stream_options":{"include_usage":true}}},"tools":{"summary":"Call a tool","value":{"model":"ostra-pro","messages":[{"role":"user","content":"Run tests/checkout.spec.ts and tell me what failed."}],"tools":[{"type":"function","function":{"name":"run_tests","description":"Run part of the test suite and return its output.","parameters":{"type":"object","properties":{"path":{"type":"string","description":"Test file or directory"}},"required":["path"]}}}],"reasoning_effort":"low"}},"image":{"summary":"Send a screenshot","value":{"model":"ostra-pro","messages":[{"role":"user","content":[{"type":"text","text":"List the visual bugs on this checkout page."},{"type":"image_url","image_url":{"url":"https://docs.testrelic.ai/img/samples/checkout.png"}}]}],"reasoning_effort":"medium"}}}}}},"responses":{"200":{"description":"200 · Completion; 200 · Stream; 200 · Tool call","headers":{"x-request-id":{"description":"Id of this request (`req_` + 26 characters). Quote it to support.","schema":{"type":"string"}},"ostra-ratelimit-requests-limit":{"description":"Your workspace’s requests-per-minute limit.","schema":{"type":"integer"}},"ostra-ratelimit-requests-remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"ostra-ratelimit-requests-reset":{"description":"Seconds until the current minute ends and the count resets.","schema":{"type":"integer"}},"ostra-model-version":{"description":"Ostra Pro version that answered: `1.0`.","schema":{"type":"string"}},"ostra-cost-usd":{"description":"Non-streaming only: what this request cost.","schema":{"type":"string"}},"ostra-balance-remaining-usd":{"description":"Workspace credit balance after this request, in USD. Approximate under concurrent requests.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Completion id."},"object":{"type":"string","description":"`chat.completion` (or `chat.completion.chunk` when streaming)."},"created":{"type":"integer","description":"Unix time."},"model":{"type":"string","description":"`ostra-pro`."},"choices":{"type":"array","description":"One choice.","items":{"type":"object","properties":{"index":{"type":"integer","description":"Always 0."},"message":{"type":"object","description":"The reply.","properties":{"role":{"type":"string","description":"`assistant`."},"content":{"type":["string","null"],"description":"The answer text."},"reasoning_content":{"type":["string","null"],"description":"The model’s reasoning, when thinking is on."},"tool_calls":{"type":"array","description":"Tool calls the model wants you to run: `{ \"id\", \"type\": \"function\", \"function\": { \"name\", \"arguments\" } }`.","items":{"type":"object"}}}},"finish_reason":{"type":"string","description":"`stop`, `length` (hit the token limit) or `tool_calls`."}}}},"usage":{"type":"object","description":"Token counts this request was billed for.","properties":{"prompt_tokens":{"type":"integer","description":"Input tokens, cached ones included."},"completion_tokens":{"type":"integer","description":"Output tokens, reasoning included."},"total_tokens":{"type":"integer","description":"Sum of the two."},"prompt_tokens_details":{"type":"object","description":"Breakdown of input.","properties":{"cached_tokens":{"type":"integer","description":"Input tokens served from the prompt cache, billed at the cached rate."}}}}}}},"examples":{"ok":{"summary":"200 · Completion","value":{"id":"chatcmpl-7f3a9c1e2b4d","object":"chat.completion","created":1795615200,"model":"ostra-pro","choices":[{"index":0,"message":{"role":"assistant","content":"CI machines are slower and run tests in parallel, so the coupon button renders after your 30 s timeout. Wait for the state you need instead of a fixed time: `await expect(page.getByRole('button', { name: 'Apply coupon' })).toBeEnabled()` before clicking, and stop sharing the cart between tests so parallel workers don’t race.","reasoning_content":"Timeout only on CI: likely slower runners or shared state between parallel tests…"},"finish_reason":"stop"}],"usage":{"prompt_tokens":52,"completion_tokens":170,"total_tokens":222,"prompt_tokens_details":{"cached_tokens":0}}}},"tools":{"summary":"200 · Tool call","value":{"id":"chatcmpl-1c2d3e4f5a6b","object":"chat.completion","created":1795615260,"model":"ostra-pro","choices":[{"index":0,"message":{"role":"assistant","content":null,"tool_calls":[{"id":"call_8d1f","type":"function","function":{"name":"run_tests","arguments":"{\"path\": \"tests/checkout.spec.ts\"}"}}]},"finish_reason":"tool_calls"}],"usage":{"prompt_tokens":214,"completion_tokens":38,"total_tokens":252,"prompt_tokens_details":{"cached_tokens":0}}}}}},"text/event-stream":{"schema":{"type":"string"},"example":"data: {\"id\":\"chatcmpl-7f3a9c1e2b4d\",\"object\":\"chat.completion.chunk\",\"created\":1795615200,\"model\":\"ostra-pro\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-7f3a9c1e2b4d\",\"object\":\"chat.completion.chunk\",\"created\":1795615200,\"model\":\"ostra-pro\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"CI machines are slower\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-7f3a9c1e2b4d\",\"object\":\"chat.completion.chunk\",\"created\":1795615200,\"model\":\"ostra-pro\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}]}\n\ndata: {\"id\":\"chatcmpl-7f3a9c1e2b4d\",\"object\":\"chat.completion.chunk\",\"created\":1795615200,\"model\":\"ostra-pro\",\"choices\":[],\"usage\":{\"prompt_tokens\":52,\"completion_tokens\":170,\"total_tokens\":222,\"prompt_tokens_details\":{\"cached_tokens\":0}}}\n\ndata: [DONE]\n"}}},"400":{"description":"`invalid_request`: Validation failed (`param` names the field), or the model rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`authentication_error`: The API key is missing, malformed, unknown, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`insufficient_balance`: Your balance doesn’t cover the request’s maximum cost. Top up or lower `max_tokens`. `spend_limit_reached`: The workspace’s monthly spend limit (`scope: \"org\"`) or this key’s monthly spend cap (`scope: \"key\"`) is reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`permission_error`: The caller’s IP isn’t in the key’s allowlist, or a read-only key called a route that needs full access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`payload_too_large`: The body is larger than 5.5 MB (images and video count).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limit_exceeded`: The workspace’s requests-per-minute limit is reached. Wait `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`upstream_error`: Ostra Pro failed to answer. Nothing was charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`service_unavailable`: Ostra Pro is starting after a quiet period (`state: \"starting\"`, retry after 60 s) or at capacity (retry after 5 s). Nothing was charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages":{"post":{"operationId":"messages","summary":"Create a message","description":"Sends a conversation to Ostra Pro in Anthropic Messages format. Anthropic SDKs and Anthropic-compatible tools work unchanged.\n\nPoint an Anthropic client at base URL `https://ostra.testrelic.ai/api` (the SDK adds `/v1/messages`) with your Ostra key. The `model` you send is ignored: Ostra Pro always answers, and the response says `ostra-pro`.\n\nSome Anthropic options are adapted: `output_config.effort` above `medium` runs as `medium`; `tool_choice` `any` or `tool` runs as `auto`, and `none` removes the tools; mid-conversation `system` messages are folded into the next user turn. Errors use the Anthropic error shape. `count_tokens` isn’t supported.\n\n**Cost:** Same rates as chat completions. Input is `input_tokens + cache_read_input_tokens + cache_creation_input_tokens`; `cache_read_input_tokens` bill at the cached rate.","tags":["Ostra Pro"],"security":[{"apiKeyHeader":[]},{"bearerAuth":[]}],"externalDocs":{"url":"https://docs.testrelic.ai/lores/api/pro/messages"},"parameters":[{"name":"x-ostra-session","in":"header","required":false,"description":"Optional. One value per conversation or agent run (1–128 letters, digits, `_`, `.`, `:` or `-`). Requests with the same value are routed to the same model replica when possible, so more of the conversation’s earlier turns are served from the prompt cache and bill as cached input. Best effort: an unknown value or a different replica just means no cache hit. See [Sessions and caching](https://docs.testrelic.ai/lores/api/sessions-and-caching).","schema":{"type":"string","pattern":"^[\\w.:-]{1,128}$"}},{"name":"anthropic-version","in":"header","required":false,"description":"Accepted and ignored, so SDK defaults work.","schema":{"type":"string"}},{"name":"anthropic-beta","in":"header","required":false,"description":"Accepted and ignored.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Optional and ignored: Ostra Pro answers whatever you send. Anthropic SDKs require one; use `ostra-pro`."},"messages":{"type":"array","description":"The conversation. Up to 8 `image` blocks per request, including those inside `tool_result`.","minItems":1,"maxItems":4000,"items":{"type":"object","properties":{"role":{"type":"string","description":"Who wrote it. `system` mid-conversation is folded into the next user turn.","enum":["user","assistant","system"]},"content":{"description":"Text, or content blocks (`text`, `image`, `tool_use`, `tool_result`, `thinking`)."}},"required":["role","content"]}},"system":{"description":"System prompt."},"max_tokens":{"type":"integer","description":"Most output tokens, thinking included. Above 32,768 is lowered to 32,768.","default":8192,"minimum":1},"stream":{"type":"boolean","description":"Stream Anthropic events (`message_start`, `content_block_*`, `message_delta`, `message_stop`).","default":false},"tools":{"type":"array","description":"Tools in Anthropic format: `{ \"name\", \"description\", \"input_schema\" }`.","maxItems":128,"items":{"type":"object"}},"tool_choice":{"type":"object","description":"`{ \"type\": \"auto\" }` or `{ \"type\": \"none\" }`. `any` and `tool` run as `auto`."},"thinking":{"type":"object","description":"Passed through, e.g. `{ \"type\": \"enabled\", \"budget_tokens\": 2048 }`."},"output_config":{"type":"object","description":"`effort`: `low` or `medium` (higher values run as `medium`)."},"temperature":{"type":"number","description":"Sampling temperature.","minimum":0,"maximum":1},"metadata":{"type":"object","description":"Passed through."}},"required":["messages"]},"examples":{"basic":{"summary":"Ask a question","value":{"model":"ostra-pro","max_tokens":1024,"system":"You are a senior test engineer. Answer briefly.","messages":[{"role":"user","content":"This Playwright test times out on CI but passes locally. Why, and how do I fix it?"}]}}}}}},"responses":{"200":{"description":"200 · Message","headers":{"x-request-id":{"description":"Id of this request (`req_` + 26 characters). Quote it to support.","schema":{"type":"string"}},"ostra-ratelimit-requests-limit":{"description":"Your workspace’s requests-per-minute limit.","schema":{"type":"integer"}},"ostra-ratelimit-requests-remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"ostra-ratelimit-requests-reset":{"description":"Seconds until the current minute ends and the count resets.","schema":{"type":"integer"}},"request-id":{"description":"Same as `x-request-id`, under Anthropic’s name.","schema":{"type":"string"}},"ostra-model-version":{"description":"`1.0`.","schema":{"type":"string"}},"ostra-cost-usd":{"description":"Non-streaming only: what this request cost.","schema":{"type":"string"}},"ostra-balance-remaining-usd":{"description":"Workspace credit balance after this request, in USD. Approximate under concurrent requests.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Message id."},"type":{"type":"string","description":"`message`."},"role":{"type":"string","description":"`assistant`."},"model":{"type":"string","description":"`ostra-pro`."},"content":{"type":"array","description":"Content blocks: `thinking` (when thinking is on), `text`, `tool_use`.","items":{"type":"object"}},"stop_reason":{"type":"string","description":"`end_turn`, `max_tokens` or `tool_use`."},"stop_sequence":{"type":["string","null"],"description":"The stop sequence that ended the answer, if any."},"usage":{"type":"object","description":"`input_tokens`, `output_tokens`, `cache_read_input_tokens`, `cache_creation_input_tokens`."}}},"examples":{"ok":{"summary":"200 · Message","value":{"id":"msg_01JDXKA2B3C4D5E6F7G8H9J0K1","type":"message","role":"assistant","model":"ostra-pro","content":[{"type":"thinking","thinking":"Timeout only on CI: likely slower runners or shared state between parallel tests…","signature":""},{"type":"text","text":"CI machines are slower and run tests in parallel, so the coupon button renders after your 30 s timeout. Wait for the state you need instead of a fixed time: `await expect(page.getByRole('button', { name: 'Apply coupon' })).toBeEnabled()` before clicking, and stop sharing the cart between tests so parallel workers don’t race."}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":52,"output_tokens":170,"cache_read_input_tokens":0,"cache_creation_input_tokens":0}}}}}}},"400":{"description":"`invalid_request_error`: Validation failed, or the model rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`authentication_error`: Missing or invalid key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`billing_error`: Balance too low, or a spend limit reached (`ostra_type` says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`permission_error`: IP not allowed, or a read-only key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`request_too_large`: Body larger than 5.5 MB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limit_error`: Rate limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`api_error`: Ostra Pro failed to answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`overloaded_error`: Ostra Pro is starting or at capacity. Retry after `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/warm":{"post":{"operationId":"warm","summary":"Warm up Ostra Pro","description":"Starts Ostra Pro if it’s asleep, so the next request doesn’t wait for a cold start.\n\nOstra Pro scales to zero after 5 quiet minutes. A cold start usually takes under a minute, and up to about 5 minutes the first time after a model update. Call this before a burst of work (a CI job, an agent run) and poll it until it says `ready`.\n\n**Cost:** Free. Any key works, read-only included. Not rate limited.","tags":["Ostra Pro"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"externalDocs":{"url":"https://docs.testrelic.ai/lores/api/pro/warm"},"responses":{"200":{"description":"200 · Ready","headers":{"x-request-id":{"description":"Id of this request (`req_` + 26 characters). Quote it to support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"`ostra-pro`."},"state":{"type":"string","description":"`ready`: a replica is up. `starting`: one is starting; poll again.","enum":["ready","starting"]},"retry_after_seconds":{"type":"integer","description":"With `starting`: when to poll again (30)."}}},"examples":{"ready":{"summary":"200 · Ready","value":{"model":"ostra-pro","state":"ready"}}}}}},"202":{"description":"202 · Starting","headers":{"x-request-id":{"description":"Id of this request (`req_` + 26 characters). Quote it to support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"`ostra-pro`."},"state":{"type":"string","description":"`ready`: a replica is up. `starting`: one is starting; poll again.","enum":["ready","starting"]},"retry_after_seconds":{"type":"integer","description":"With `starting`: when to poll again (30)."}}},"examples":{"starting":{"summary":"202 · Starting","value":{"model":"ostra-pro","state":"starting","retry_after_seconds":30}}}}}},"401":{"description":"`authentication_error`: The API key is missing, malformed, unknown, revoked or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`permission_error`: The caller’s IP isn’t in the key’s allowlist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`upstream_error`: Ostra Pro answered unexpectedly. Retry shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"billing.topup":{"post":{"operationId":"webhook_billing_topup","summary":"billing.topup","security":[],"description":"A top-up payment succeeded. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"billing.auto_topup":{"post":{"operationId":"webhook_billing_auto_topup","summary":"billing.auto_topup","security":[],"description":"An auto top-up charged the saved card. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"billing.auto_topup_failed":{"post":{"operationId":"webhook_billing_auto_topup_failed","summary":"billing.auto_topup_failed","security":[],"description":"An auto top-up charge failed. Three failures in a row turn auto top-up off. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"billing.coupon_redeemed":{"post":{"operationId":"webhook_billing_coupon_redeemed","summary":"billing.coupon_redeemed","security":[],"description":"A coupon code added credit. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"billing.spend_alert":{"post":{"operationId":"webhook_billing_spend_alert","summary":"billing.spend_alert","security":[],"description":"This month’s spend crossed the alert percentage of the monthly spend limit (once a month). Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"api_key.created":{"post":{"operationId":"webhook_api_key_created","summary":"api_key.created","security":[],"description":"A key was created. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"api_key.revoked":{"post":{"operationId":"webhook_api_key_revoked","summary":"api_key.revoked","security":[],"description":"A key was revoked. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"member.joined":{"post":{"operationId":"webhook_member_joined","summary":"member.joined","security":[],"description":"Someone joined the workspace. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"member.removed":{"post":{"operationId":"webhook_member_removed","summary":"member.removed","security":[],"description":"A member was removed. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"member.role_changed":{"post":{"operationId":"webhook_member_role_changed","summary":"member.role_changed","security":[],"description":"A member’s role changed. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"mcp.tool_enabled":{"post":{"operationId":"webhook_mcp_tool_enabled","summary":"mcp.tool_enabled","security":[],"description":"An MCP tool was turned on. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"mcp.tool_disabled":{"post":{"operationId":"webhook_mcp_tool_disabled","summary":"mcp.tool_disabled","security":[],"description":"An MCP tool was turned off. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}},"webhook.test":{"post":{"operationId":"webhook_webhook_test","summary":"webhook.test","security":[],"description":"You clicked Send test event. Verify `Ostra-Signature` before trusting the body: https://docs.testrelic.ai/lores/api/webhooks","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Return any 2xx within 3 seconds."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An Ostra API key (`ostk_live_…`) from the TestRelic Console."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"The same key, for Ostra Pro routes (Anthropic-style clients)."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","description":"Error type, e.g. `invalid_request`, `insufficient_balance`, `rate_limit_exceeded`."},"message":{"type":"string"},"param":{"type":"string","description":"The field that failed validation."},"retry_after_ms":{"type":"integer"},"request_id":{"type":"string"}},"required":["type","message"]}},"required":["error"]},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string","description":"Event id, `evt_…`."},"type":{"type":"string","enum":["billing.topup","billing.auto_topup","billing.auto_topup_failed","billing.coupon_redeemed","billing.spend_alert","api_key.created","api_key.revoked","member.joined","member.removed","member.role_changed","mcp.tool_enabled","mcp.tool_disabled","webhook.test"]},"created_at":{"type":"string","format":"date-time"},"workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"data":{"type":"object","description":"For webhook.test: { message }. Otherwise who did it (an email, or System) and a one-line detail (up to 500 characters).","properties":{"actor":{"type":"string"},"detail":{"type":"string","maxLength":500},"message":{"type":"string"}}}},"required":["id","type","created_at","workspace","data"]}}}}