{"openapi":"3.1.0","info":{"title":"telemetry.dev API","version":"1.0.0","description":"telemetry.dev API: telemetry ingest, prompt fetches, and Evals for telemetry.dev, the observability platform for AI and LLM apps.\n\nTelemetry is ingested over OTLP/HTTP at `POST /v1/traces`, `POST /v1/logs`, and `POST /v1/metrics` with `application/x-protobuf` or `application/json`. The document gives their bodies as binary protobuf or as a JSON object, without the OTLP protobuf schemas. Apps fetch prompts and datasets, send the runs of experiments, and send scores to the same host.\n\nThe API has a version in its URL path (`/v1`). A breaking change ships under a new `/vN` prefix. This document announces each deprecation, and a deprecated version answers with a `Sunset` header when its removal date is set.\n\nRequests authenticate with a project API key (`Authorization: Bearer td_live_<random>`), which you make in the dashboard after signup. The OTLP routes need the `telemetry:write` scope, which the API keys page shows as Send telemetry. Each other endpoint names the scope that it needs.\n\nSetup guides for SDKs and frameworks: https://telemetry.dev/docs/integrations. Site overview for agents: https://telemetry.dev/llms.txt"},"paths":{"/health":{"get":{"tags":["Health"],"operationId":"health","parameters":[],"security":[],"responses":{"200":{"description":"Liveness probe response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}},"summary":"Liveness probe"}},"/v1/traces":{"post":{"operationId":"exportTraces","tags":["Telemetry"],"summary":"Export traces (OTLP/HTTP)","description":"Accepts one OTLP/HTTP ExportTraceServiceRequest payload and stores it for the project that owns the API key. Use `application/x-protobuf` for binary OTLP or `application/json` for OTLP/JSON. The API accepts gzip compression with `Content-Encoding: gzip`. It treats identity as absent. The raw and decompressed body limits are each 16 MiB. A successful request accepts the full batch. An error rejects the full request. The response uses the request encoding. A protobuf request receives an empty binary ExportTraceServiceResponse. A JSON request receives `{}`. A JSON error contains a message object. A protobuf error contains a Status message. The API key must have Send telemetry in its Access on the API keys page (the `telemetry:write` scope). An API key applies to one environment or to all environments. A key without Send telemetry, a project with Accept telemetry turned off, or an environment mismatch returns 403.","security":[{"projectApiKey":["telemetry:write"]}],"requestBody":{"x-max-body-bytes":16777216,"required":true,"content":{"application/x-protobuf":{"schema":{"type":"string","format":"binary","description":"Binary protobuf ExportTraceServiceRequest."}},"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"OTLP/JSON ExportTraceServiceRequest. The payload must decode as ExportTraceServiceRequest; an empty batch (no trace records) is rejected with 400."}}}},"parameters":[{"name":"Content-Encoding","in":"header","required":false,"schema":{"type":"string","enum":["gzip","identity"]},"description":"gzip compresses the request body; identity (or absence) sends it raw."}],"responses":{"200":{"description":"The server accepted the full batch. The body is an empty ExportTraceServiceResponse for protobuf or {} for JSON. The server does not return partial success. An error rejects the full request. Free-plan responses include RateLimit-Limit and RateLimit-Reset headers.","headers":{"RateLimit-Limit":{"description":"The monthly cap of ingestion units of a free-plan workspace, past which ingest rejects a batch. Paid plans do not get it.","schema":{"type":"string"}},"RateLimit-Reset":{"description":"Seconds until the monthly cap resets at the start of the next UTC month.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Payload did not decode, decompression failed, or the batch contained no records.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"The Authorization header is missing or is not `Bearer <project API key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"The API key does not have Send telemetry in its Access (the `telemetry:write` scope), the project has Accept telemetry turned off in its settings, or the key applies to a different environment. The message identifies the cause.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"409":{"description":"Telemetry for the project or a trace in the batch was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"413":{"description":"The body is more than 16 MiB raw or decompressed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"415":{"description":"Content-Type is not application/x-protobuf or application/json, or Content-Encoding is not gzip or identity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"429":{"description":"The monthly ingestion quota is exceeded.","headers":{"RateLimit-Limit":{"description":"The monthly cap of ingestion units of a free-plan workspace, past which ingest rejects a batch. Paid plans do not get it.","schema":{"type":"string"}},"RateLimit-Reset":{"description":"Seconds until the monthly cap resets at the start of the next UTC month.","schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"500":{"description":"An internal operation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"503":{"description":"The API key lookup or persistence failed, or the server is busy. You can safely try the request again.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}}}}},"/v1/logs":{"post":{"operationId":"exportLogs","tags":["Telemetry"],"summary":"Export logs (OTLP/HTTP)","description":"Accepts one OTLP/HTTP ExportLogsServiceRequest payload and stores it for the project that owns the API key. Use `application/x-protobuf` for binary OTLP or `application/json` for OTLP/JSON. The API accepts gzip compression with `Content-Encoding: gzip`. It treats identity as absent. The raw and decompressed body limits are each 16 MiB. A successful request accepts the full batch. An error rejects the full request. The response uses the request encoding. A protobuf request receives an empty binary ExportLogsServiceResponse. A JSON request receives `{}`. A JSON error contains a message object. A protobuf error contains a Status message. The API key must have Send telemetry in its Access on the API keys page (the `telemetry:write` scope). An API key applies to one environment or to all environments. A key without Send telemetry, a project with Accept telemetry turned off, or an environment mismatch returns 403.","security":[{"projectApiKey":["telemetry:write"]}],"requestBody":{"x-max-body-bytes":16777216,"required":true,"content":{"application/x-protobuf":{"schema":{"type":"string","format":"binary","description":"Binary protobuf ExportLogsServiceRequest."}},"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"OTLP/JSON ExportLogsServiceRequest. The payload must decode as ExportLogsServiceRequest; an empty batch (no log records) is rejected with 400."}}}},"parameters":[{"name":"Content-Encoding","in":"header","required":false,"schema":{"type":"string","enum":["gzip","identity"]},"description":"gzip compresses the request body; identity (or absence) sends it raw."}],"responses":{"200":{"description":"The server accepted the full batch. The body is an empty ExportLogsServiceResponse for protobuf or {} for JSON. The server does not return partial success. An error rejects the full request. Free-plan responses include RateLimit-Limit and RateLimit-Reset headers.","headers":{"RateLimit-Limit":{"description":"The monthly cap of ingestion units of a free-plan workspace, past which ingest rejects a batch. Paid plans do not get it.","schema":{"type":"string"}},"RateLimit-Reset":{"description":"Seconds until the monthly cap resets at the start of the next UTC month.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Payload did not decode, decompression failed, or the batch contained no records.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"The Authorization header is missing or is not `Bearer <project API key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"The API key does not have Send telemetry in its Access (the `telemetry:write` scope), the project has Accept telemetry turned off in its settings, or the key applies to a different environment. The message identifies the cause.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"409":{"description":"Telemetry for the project or a trace in the batch was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"413":{"description":"The body is more than 16 MiB raw or decompressed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"415":{"description":"Content-Type is not application/x-protobuf or application/json, or Content-Encoding is not gzip or identity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"429":{"description":"The monthly ingestion quota is exceeded.","headers":{"RateLimit-Limit":{"description":"The monthly cap of ingestion units of a free-plan workspace, past which ingest rejects a batch. Paid plans do not get it.","schema":{"type":"string"}},"RateLimit-Reset":{"description":"Seconds until the monthly cap resets at the start of the next UTC month.","schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"500":{"description":"An internal operation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"503":{"description":"The API key lookup or persistence failed, or the server is busy. You can safely try the request again.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}}}}},"/v1/metrics":{"post":{"operationId":"exportMetrics","tags":["Telemetry"],"summary":"Export metrics (OTLP/HTTP)","description":"Accepts one OTLP/HTTP ExportMetricsServiceRequest payload and stores it for the project that owns the API key. Use `application/x-protobuf` for binary OTLP or `application/json` for OTLP/JSON. The API accepts gzip compression with `Content-Encoding: gzip`. It treats identity as absent. The raw and decompressed body limits are each 16 MiB. A successful request accepts the full batch. An error rejects the full request. The response uses the request encoding. A protobuf request receives an empty binary ExportMetricsServiceResponse. A JSON request receives `{}`. A JSON error contains a message object. A protobuf error contains a Status message. The API key must have Send telemetry in its Access on the API keys page (the `telemetry:write` scope). An API key applies to one environment or to all environments. A key without Send telemetry, a project with Accept telemetry turned off, or an environment mismatch returns 403.","security":[{"projectApiKey":["telemetry:write"]}],"requestBody":{"x-max-body-bytes":16777216,"required":true,"content":{"application/x-protobuf":{"schema":{"type":"string","format":"binary","description":"Binary protobuf ExportMetricsServiceRequest."}},"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"OTLP/JSON ExportMetricsServiceRequest. The payload must decode as ExportMetricsServiceRequest; an empty batch (no metric records) is rejected with 400."}}}},"parameters":[{"name":"Content-Encoding","in":"header","required":false,"schema":{"type":"string","enum":["gzip","identity"]},"description":"gzip compresses the request body; identity (or absence) sends it raw."}],"responses":{"200":{"description":"The server accepted the full batch. The body is an empty ExportMetricsServiceResponse for protobuf or {} for JSON. The server does not return partial success. An error rejects the full request. Free-plan responses include RateLimit-Limit and RateLimit-Reset headers.","headers":{"RateLimit-Limit":{"description":"The monthly cap of ingestion units of a free-plan workspace, past which ingest rejects a batch. Paid plans do not get it.","schema":{"type":"string"}},"RateLimit-Reset":{"description":"Seconds until the monthly cap resets at the start of the next UTC month.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Payload did not decode, decompression failed, or the batch contained no records.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"The Authorization header is missing or is not `Bearer <project API key>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"The API key does not have Send telemetry in its Access (the `telemetry:write` scope), the project has Accept telemetry turned off in its settings, or the key applies to a different environment. The message identifies the cause.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"409":{"description":"Telemetry for the project or a trace in the batch was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"413":{"description":"The body is more than 16 MiB raw or decompressed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"415":{"description":"Content-Type is not application/x-protobuf or application/json, or Content-Encoding is not gzip or identity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"429":{"description":"The monthly ingestion quota is exceeded.","headers":{"RateLimit-Limit":{"description":"The monthly cap of ingestion units of a free-plan workspace, past which ingest rejects a batch. Paid plans do not get it.","schema":{"type":"string"}},"RateLimit-Reset":{"description":"Seconds until the monthly cap resets at the start of the next UTC month.","schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"500":{"description":"An internal operation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}},"503":{"description":"The API key lookup or persistence failed, or the server is busy. You can safely try the request again.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/x-protobuf":{"schema":{"type":"string","format":"binary"}}}}}}},"/v1/prompts":{"get":{"tags":["Prompts"],"operationId":"getPrompt","parameters":[{"name":"name","in":"query","schema":{"type":"string","description":"The prompt name, as `support/reply`."},"required":true},{"name":"label","in":"query","schema":{"type":"string","description":"The label to fetch. `latest` is the newest version. Without a label or a version the request gets `production`."},"required":false},{"name":"version","in":"query","schema":{"type":"string","pattern":"^[1-9][0-9]{0,8}$","description":"The version number to fetch. Give a label or a version, not both."},"required":false}],"security":[{"projectApiKey":["prompts:read"]}],"responses":{"200":{"description":"A prompt version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prompt"}}}},"400":{"description":"The query is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidPromptRequest"}}}},"401":{"description":"The API key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidApiKey"}}}},"403":{"description":"The API key does not have the `prompts:read` scope. On the API keys page, its Access does not have Read prompts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientScope"}}}},"404":{"description":"The project has no such prompt or version, or the prompt has no such label.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptNotFound"}}}},"422":{"description":"An included prompt is missing or is a chat prompt, includes nest more than 3 levels deep, or includes are too many or too long. A version that you fetch by its number can get `include_not_found` after a prompt that it includes is renamed or deleted, or loses the label that the include follows: other prompts hold those changes back only while their newest version or a labeled version includes the prompt, directly or through other versions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptIncludeFailed"}}}},"429":{"description":"Too many requests. The `retry-after` header gives the seconds to wait.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}},"500":{"description":"The server failed to answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptServerError"}}}},"503":{"description":"Prompts are unavailable right now, or the API key lookup failed. An `authentication_failed` error has a `retry-after` header with the seconds to wait.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptsUnavailable"}}}}},"description":"Gets a version of a prompt of the key's project: by label, by version number, or the production label by default. Included prompts are put into the text, and `{{variable}}` tags stay for the SDK to fill. The key needs the `prompts:read` scope, which the API keys page shows as Read prompts. The SDKs call this route from `getPrompt` (TypeScript) and `get_prompt` (Python).","summary":"Get a prompt"}},"/v1/datasets/{name}":{"get":{"tags":["Datasets"],"operationId":"getDataset","parameters":[{"name":"name","in":"path","schema":{"type":"string","description":"The dataset name, as `support-golden`."},"required":true},{"name":"version","in":"query","schema":{"type":"string","pattern":"^[1-9][0-9]{0,8}$","description":"The version to read. Without it the newest version."},"required":false},{"name":"split","in":"query","schema":{"type":"string","description":"Only the items of this split."},"required":false},{"name":"cursor","in":"query","schema":{"type":"string","description":"The `nextCursor` of the page before."},"required":false},{"name":"limit","in":"query","schema":{"type":"string","pattern":"^[1-9][0-9]{0,8}$","description":"Items in the page, 1 to 100. 100 by default."},"required":false}],"security":[{"projectApiKey":["datasets:read"]}],"responses":{"200":{"description":"A page of the items of a dataset version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetPage"}}}},"400":{"description":"The query is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidEvalsQuery"}}}},"401":{"description":"The API key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidApiKey"}}}},"403":{"description":"The API key does not have the scope that the endpoint names. On the API keys page, its Access does not have Run experiments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsInsufficientScope"}}}},"404":{"description":"The project has no dataset of this name, or the dataset has no such version. No route matches a path with an empty value.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DatasetNotFound"},{"$ref":"#/components/schemas/RouteNotFound"}]}}}},"429":{"description":"Too many requests. The `retry-after` header gives the seconds to wait.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}},"500":{"description":"The server failed to answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsServerError"}}}},"503":{"description":"Evals are unavailable right now, or the API key lookup failed. The `retry-after` header gives the seconds to wait.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsUnavailable"}}}}},"description":"Gets the items of a dataset version in number order, a page at a time. A page has at most `limit` items, and it ends early after `x-max-page-bytes` bytes of items. Send `nextCursor` as `cursor` for the next page. The cursor holds the version, so each page reads the same version while the dataset changes. The key needs the `datasets:read` scope, which the API keys page gives with Run experiments.","summary":"Get the items of a dataset","x-max-page-bytes":4194304}},"/v1/experiments":{"post":{"tags":["Experiments"],"operationId":"createExperiment","parameters":[],"security":[{"projectApiKey":["experiments:write"]}],"responses":{"201":{"description":"The experiment, running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewExperiment"}}}},"400":{"description":"The body is not JSON of the right shape, its text holds U+0000 or a lone surrogate, or its gzip does not decompress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidEvalsBody"}}}},"401":{"description":"The API key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidApiKey"}}}},"403":{"description":"The API key does not have the scope that the endpoint names (on the API keys page, its Access does not have Run experiments), or Accept telemetry is off in the settings of its project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsWriteRefused"}}}},"404":{"description":"The project has no dataset of this name, or the dataset has no such version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentDatasetNotFound"}}}},"409":{"description":"The name and the next free numbers after it are taken.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentNameTaken"}}}},"413":{"description":"The body is over the limit of the endpoint, before or after gzip.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsBodyTooLarge"}}}},"415":{"description":"Content-Encoding is not gzip or identity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsUnsupportedEncoding"}}}},"422":{"description":"The dataset version has no items, or an evaluator is missing or is not an LLM judge, a code check, or a rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentNotStarted"}}}},"429":{"description":"Too many requests for the project (`rate_limited`), or the write would take the workspace past a monthly cap of its plan (`quota_exceeded`): the ingestion units of Free, or the Evals text of any plan. The `retry-after` header gives the seconds to wait, which for a monthly cap is the start of next month. A lifetime gift budget that ran out has no `retry-after`.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsWriteRefusedByLimit"}}}},"500":{"description":"The server failed to answer, or the privacy settings of the project are not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsWriteServerError"}}}},"503":{"description":"Evals are unavailable right now, or the API key lookup failed. The `retry-after` header gives the seconds to wait.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsUnavailable"}}}}},"description":"Starts an experiment on a dataset version. Your code runs each item and sends the runs to `POST /v1/experiments/{id}/items`. Without a name the experiment is `<dataset>-v<version>`, and a name that the project has gets `-2`, `-3`, and so on. The body is at most 1 MiB. The key needs the `experiments:write` scope, which the API keys page gives with Run experiments.","summary":"Start an experiment of your code","requestBody":{"x-max-body-bytes":1048576,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"dataset":{"type":"string"},"datasetVersion":{"type":"integer","minimum":1,"description":"The dataset version to run. Without it the newest version runs."},"split":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Run only the items of this split."},"runsPerItem":{"type":"integer","minimum":1,"maximum":5,"description":"Runs of each item, 1 by default."},"evaluators":{"type":"array","items":{"type":"string"},"maxItems":20,"description":"Names of LLM judges, code checks, and rules of the project. The server scores each item run with them."},"minScores":{"type":"object","additionalProperties":{"type":"number"},"maxProperties":20,"allOf":[{"description":"Pass marks by score name: the lowest pass rate (0 to 1) of a pass/fail score, or the lowest mean of a number score. The experiment check fails when a score is under its mark. A name of one of `evaluators` in another case takes the name of the evaluator, as `correctness` for Correctness. The mark of one of `evaluators` must be inside its range (0 to 1 for pass/fail), and an evaluator of labels takes none. The range of a score that the app sends is not checked."}]},"ci":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","enum":["github_actions"]},"repository":{"type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+$"},"prNumber":{"type":"integer","exclusiveMinimum":0},"prTitle":{"type":"string","maxLength":256},"prUrl":{"type":"string","maxLength":2048,"pattern":"^https:\\/\\/\\S+$"},"commit":{"type":"string","pattern":"^[0-9a-fA-F]{7,64}$"},"runUrl":{"type":"string","maxLength":2048,"pattern":"^https:\\/\\/\\S+$"}},"required":["provider","repository","commit"],"additionalProperties":false},{"type":"null"}],"description":"The CI run, which the experiment page links to."},"metadata":{"type":"object","allOf":[{"description":"Up to 16 KiB of JSON that the experiment keeps. The server redacts its strings as it redacts span attributes, and drops the values of secret keys such as `apiKey`."}]}},"required":["dataset"],"additionalProperties":false}}},"required":true}}},"/v1/experiments/{id}/items":{"post":{"tags":["Experiments"],"operationId":"addExperimentItems","parameters":[{"name":"id","in":"path","schema":{"type":"string","format":"uuid","description":"The experiment id."},"required":true}],"security":[{"projectApiKey":["experiments:write"]}],"responses":{"200":{"description":"`accepted`, the runs that the request added, and `duplicates`, the runs that the experiment had.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentItemsAccepted"}}}},"400":{"description":"The body is not JSON of the right shape, its text holds U+0000 or a lone surrogate, or its gzip does not decompress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidEvalsBody"}}}},"401":{"description":"The API key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidApiKey"}}}},"403":{"description":"The API key does not have the scope that the endpoint names (on the API keys page, its Access does not have Run experiments), or Accept telemetry is off in the settings of its project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsWriteRefused"}}}},"404":{"description":"The project has no experiment with this id. No route matches a path with an empty value.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ExperimentNotFound"},{"$ref":"#/components/schemas/RouteNotFound"}]}}}},"409":{"description":"The experiment ended, or it runs a prompt version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentNotOpen"}}}},"413":{"description":"The body is over the limit of the endpoint, before or after gzip.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsBodyTooLarge"}}}},"415":{"description":"Content-Encoding is not gzip or identity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsUnsupportedEncoding"}}}},"422":{"description":"An `itemId` is not an item of the dataset version and split of the experiment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentItemNotFound"}}}},"429":{"description":"Too many requests for the project (`rate_limited`), or the write would take the workspace past a monthly cap of its plan (`quota_exceeded`): the ingestion units of Free, or the Evals text of any plan. The `retry-after` header gives the seconds to wait, which for a monthly cap is the start of next month. A lifetime gift budget that ran out has no `retry-after`.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsWriteRefusedByLimit"}}}},"500":{"description":"The server failed to answer, or the privacy settings of the project are not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsWriteServerError"}}}},"503":{"description":"Evals are unavailable right now, or the API key lookup failed. The `retry-after` header gives the seconds to wait.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsUnavailable"}}}}},"description":"Sends 1 to 100 item runs, with the scores of your code. The server then scores each run with the evaluators of the experiment. A run that the experiment has, by `itemId` and `runIndex`, keeps its first post, so a request can be sent again. The request adds all of its runs or none. The body is at most 16 MiB. The key needs the `experiments:write` scope, which the API keys page gives with Run experiments.","summary":"Send item runs","requestBody":{"x-max-body-bytes":16777216,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","allOf":[{"description":"The `id` of the item in `GET /v1/datasets/{name}`."}]},"runIndex":{"type":"integer","minimum":0,"maximum":4,"description":"0 to `runsPerItem` - 1, 0 by default."},"output":{"anyOf":[{"type":"string","maxLength":100000},{"type":"null"}],"description":"The output of the task. The server keeps it as sent, since the evaluators compare it with the expected output of the item."},"traceId":{"anyOf":[{"type":"string","pattern":"^(?!0+$)[0-9a-f]{32}$"},{"type":"null"}],"description":"The trace of the run. The server reads its cost from it."},"latencyMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":2147483647},{"type":"null"}]},"costUsd":{"anyOf":[{"type":"number","minimum":0,"maximum":999999},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The error of a run that failed. The server keeps the first 4,000 characters, after the redaction of the project."},"scores":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"A number, or 1 for a pass and 0 for a fail."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A label, as `pass`, `fail`, or a label of your own."},"reason":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"required":["name"],"additionalProperties":false},"maxItems":20,"allOf":[{"description":"Scores that the app gave the output."}]}},"required":["itemId"],"additionalProperties":false},"minItems":1,"maxItems":100}},"required":["items"],"additionalProperties":false}}},"required":true}}},"/v1/experiments/{id}/complete":{"post":{"tags":["Experiments"],"operationId":"completeExperiment","parameters":[{"name":"id","in":"path","schema":{"type":"string","format":"uuid","description":"The experiment id."},"required":true}],"security":[{"projectApiKey":["experiments:write"]}],"responses":{"200":{"description":"`running` while the server scores the last runs, else the status that the experiment ended with.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletedExperiment"}}}},"401":{"description":"The API key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidApiKey"}}}},"403":{"description":"The API key does not have the scope that the endpoint names. On the API keys page, its Access does not have Run experiments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsInsufficientScope"}}}},"404":{"description":"The project has no experiment with this id. No route matches a path with an empty value.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ExperimentNotFound"},{"$ref":"#/components/schemas/RouteNotFound"}]}}}},"409":{"description":"The experiment runs a prompt version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentNotCode"}}}},"429":{"description":"Too many requests. The `retry-after` header gives the seconds to wait.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}},"500":{"description":"The server failed to answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsServerError"}}}},"503":{"description":"Evals are unavailable right now, or the API key lookup failed. The `retry-after` header gives the seconds to wait.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsUnavailable"}}}}},"description":"Tells the server that your code sent all of its runs. The experiment then completes when the server has scored them, with the check of its min scores. An experiment that ended answers with its status. The key needs the `experiments:write` scope, which the API keys page gives with Run experiments.","summary":"End the item runs"}},"/v1/experiments/{id}":{"get":{"tags":["Experiments"],"operationId":"getExperiment","parameters":[{"name":"id","in":"path","schema":{"type":"string","format":"uuid","description":"The experiment id."},"required":true}],"security":[{"projectApiKey":["experiments:write"]}],"responses":{"200":{"description":"An experiment and its scores.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentResult"}}}},"401":{"description":"The API key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidApiKey"}}}},"403":{"description":"The API key does not have the scope that the endpoint names. On the API keys page, its Access does not have Run experiments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsInsufficientScope"}}}},"404":{"description":"The project has no experiment with this id. No route matches a path with an empty value.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ExperimentNotFound"},{"$ref":"#/components/schemas/RouteNotFound"}]}}}},"429":{"description":"Too many requests. The `retry-after` header gives the seconds to wait.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimited"}}}},"500":{"description":"The server failed to answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsServerError"}}}},"503":{"description":"Evals are unavailable right now, or the API key lookup failed. The `retry-after` header gives the seconds to wait.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsUnavailable"}}}}},"description":"Gets the status and the scores of an experiment, with the change from the experiment that it compares with. The key needs the `experiments:write` scope, which the API keys page gives with Run experiments.","summary":"Get an experiment"}},"/v1/scores":{"post":{"tags":["Scores"],"operationId":"createScore","parameters":[],"security":[{"projectApiKey":["scores:write"]}],"responses":{"202":{"description":"The id of the score.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreAccepted"}}}},"400":{"description":"The body is not JSON of the right shape, its text holds U+0000 or a lone surrogate, or its gzip does not decompress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidEvalsBody"}}}},"401":{"description":"The API key is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidApiKey"}}}},"403":{"description":"The API key does not have the scope that the endpoint names (on the API keys page, its Access does not have Run experiments), or Accept telemetry is off in the settings of its project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsWriteRefused"}}}},"413":{"description":"The body is over the limit of the endpoint, before or after gzip.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsBodyTooLarge"}}}},"415":{"description":"Content-Encoding is not gzip or identity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsUnsupportedEncoding"}}}},"429":{"description":"Too many requests for the project (`rate_limited`), or the write would take the workspace past a monthly cap of its plan (`quota_exceeded`): the ingestion units of Free, or the Evals text of any plan. The `retry-after` header gives the seconds to wait, which for a monthly cap is the start of next month. A lifetime gift budget that ran out has no `retry-after`.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsWriteRefusedByLimit"}}}},"500":{"description":"The server failed to answer, or the privacy settings of the project are not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsWriteServerError"}}}},"503":{"description":"Evals are unavailable right now, or the API key lookup failed. The `retry-after` header gives the seconds to wait.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalsUnavailable"}}}}},"description":"Records a score on a trace, a span, or a session, as the feedback of a user. Give a value or a label. `user_feedback` takes the value 1 for up or 0 for down, and no label. The body is at most 64 KiB. The key needs the `scores:write` scope, which the API keys page gives with Run experiments. The environment of a key limits only the telemetry that it sends: a key of one environment can score a trace or session of any environment of the project.","summary":"Send a score","requestBody":{"x-max-body-bytes":65536,"content":{"application/json":{"schema":{"type":"object","properties":{"traceId":{"anyOf":[{"type":"string","pattern":"^(?!0+$)[0-9a-f]{32}$"},{"type":"null"}]},"spanId":{"anyOf":[{"type":"string","pattern":"^(?!0+$)[0-9a-f]{16}$"},{"type":"null"}],"description":"A span of the trace, for a score on one span."},"sessionId":{"anyOf":[{"type":"string","minLength":1,"maxLength":1024},{"type":"null"}],"description":"The session of the score, when it has no traceId. With a traceId, the score belongs to the trace and shows on the session of the trace: the server keeps sessionId but does not check it against the trace or read it. A session id that the redaction of the project would change is dropped, as ingest drops it from telemetry."},"name":{"type":"string"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"A number, or 1 for a pass and 0 for a fail."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A label, as `pass`, `fail`, or a label of your own."},"comment":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"description":"The comment of the user, which the server keeps after the redaction of the project."}},"required":["name"],"additionalProperties":false}}},"required":true}}}},"components":{"schemas":{"HealthResponse":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false,"description":"Liveness probe response."},"PromptRollout":{"type":"object","properties":{"percent":{"type":"integer","description":"The share of calls, 1 to 99."},"version":{"type":"integer"},"messages":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false},{"type":"object","properties":{"role":{"type":"string","enum":["placeholder"]},"name":{"type":"string"}},"required":["role","name"],"additionalProperties":false}]},"description":"The messages of a chat prompt, with included prompts put in. `{{variable}}` tags stay for the SDK to fill. A `placeholder` message stands for a list of messages that the app passes. Empty for a text prompt."},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The text of a text prompt, with included prompts put in. Null for a chat prompt."},"model":{"type":"object","properties":{"provider":{"type":"string","enum":["openai","anthropic","google","openai_compatible"]},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["provider","name"],"additionalProperties":false},"parameters":{"type":"object","properties":{"temperature":{"anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"topP":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"maxTokens":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}]},"frequencyPenalty":{"anyOf":[{"type":"number","minimum":-2,"maximum":2},{"type":"null"}]},"presencePenalty":{"anyOf":[{"type":"number","minimum":-2,"maximum":2},{"type":"null"}]},"stop":{"anyOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":4},{"type":"null"}]},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}]},"toolChoice":{"anyOf":[{"anyOf":[{"type":"string","enum":["auto","none","required"]},{"type":"object","properties":{"tool":{"type":"string","maxLength":64}},"required":["tool"],"additionalProperties":false}]},{"type":"null"}]},"parallelToolCalls":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false,"description":"Only the parameters that the version sets."},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"description":{"type":"string","maxLength":1024},"parameters":{"type":"object"},"strict":{"type":"boolean"}},"required":["name","description","parameters"],"additionalProperties":false}},"responseFormat":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"schema":{"type":"object"},"strict":{"type":"boolean"}},"required":["type","name","schema"],"additionalProperties":false}]}},"required":["percent","version","messages","text","model","parameters","tools","responseFormat"],"additionalProperties":false,"description":"A gradual rollout of the label: `percent` of the calls get this version. The SDK picks one version for each session."},"Prompt":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["chat","text"]},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The label that the request asked for. Null when it asked for a version."},"version":{"type":"integer"},"messages":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false},{"type":"object","properties":{"role":{"type":"string","enum":["placeholder"]},"name":{"type":"string"}},"required":["role","name"],"additionalProperties":false}]},"description":"The messages of a chat prompt, with included prompts put in. `{{variable}}` tags stay for the SDK to fill. A `placeholder` message stands for a list of messages that the app passes. Empty for a text prompt."},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The text of a text prompt, with included prompts put in. Null for a chat prompt."},"model":{"type":"object","properties":{"provider":{"type":"string","enum":["openai","anthropic","google","openai_compatible"]},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["provider","name"],"additionalProperties":false},"parameters":{"type":"object","properties":{"temperature":{"anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"topP":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"maxTokens":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}]},"frequencyPenalty":{"anyOf":[{"type":"number","minimum":-2,"maximum":2},{"type":"null"}]},"presencePenalty":{"anyOf":[{"type":"number","minimum":-2,"maximum":2},{"type":"null"}]},"stop":{"anyOf":[{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":4},{"type":"null"}]},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}]},"toolChoice":{"anyOf":[{"anyOf":[{"type":"string","enum":["auto","none","required"]},{"type":"object","properties":{"tool":{"type":"string","maxLength":64}},"required":["tool"],"additionalProperties":false}]},{"type":"null"}]},"parallelToolCalls":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"additionalProperties":false,"description":"Only the parameters that the version sets."},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"description":{"type":"string","maxLength":1024},"parameters":{"type":"object"},"strict":{"type":"boolean"}},"required":["name","description","parameters"],"additionalProperties":false}},"responseFormat":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"schema":{"type":"object"},"strict":{"type":"boolean"}},"required":["type","name","schema"],"additionalProperties":false}]},"rollout":{"anyOf":[{"$ref":"#/components/schemas/PromptRollout"},{"type":"null"}],"description":"Null without a rollout."}},"required":["name","type","label","version","messages","text","model","parameters","tools","responseFormat","rollout"],"additionalProperties":false,"description":"A prompt version."},"InvalidPromptRequest":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["invalid_request"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The query is not valid."},"InvalidApiKey":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["invalid_api_key"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The API key is not valid."},"InsufficientScope":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["insufficient_scope"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The API key does not have the `prompts:read` scope. On the API keys page, its Access does not have Read prompts."},"PromptNotFound":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["prompt_not_found","label_not_found"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The project has no such prompt or version, or the prompt has no such label."},"PromptIncludeFailed":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["include_not_found","include_not_text","include_too_deep","include_too_large"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"An included prompt is missing or is a chat prompt, includes nest more than 3 levels deep, or includes are too many or too long. A version that you fetch by its number can get `include_not_found` after a prompt that it includes is renamed or deleted, or loses the label that the include follows: other prompts hold those changes back only while their newest version or a labeled version includes the prompt, directly or through other versions."},"RateLimited":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["rate_limited"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"Too many requests. The `retry-after` header gives the seconds to wait."},"PromptServerError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The server failed to answer."},"PromptsUnavailable":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["prompts_unavailable","authentication_failed"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"Prompts are unavailable right now, or the API key lookup failed. An `authentication_failed` error has a `retry-after` header with the seconds to wait."},"DatasetPage":{"type":"object","properties":{"dataset":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer","description":"The version of the items. 0 before the first."}},"required":["id","name","version"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The item id, the same in each version. Send it as `itemId` with the run of the item."},"number":{"type":"integer","description":"The item number, as in #12."},"input":{"type":"object"},"expectedOutput":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object"},"tags":{"type":"array","items":{"type":"string"}},"split":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","number","input","expectedOutput","metadata","tags","split"],"additionalProperties":false},"description":"Items in number order."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gives the next page. It holds the version, so each page reads the same version while the dataset changes. Null on the last page."}},"required":["dataset","items","nextCursor"],"additionalProperties":false,"description":"A page of the items of a dataset version."},"InvalidEvalsQuery":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["invalid_request"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The query is not valid."},"EvalsInsufficientScope":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["insufficient_scope"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The API key does not have the scope that the endpoint names. On the API keys page, its Access does not have Run experiments."},"DatasetNotFound":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["dataset_not_found","version_not_found"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The project has no dataset of this name, or the dataset has no such version."},"RouteNotFound":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["not_found"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"No route matches the path, as when a path value is empty."},"EvalsServerError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The server failed to answer."},"EvalsUnavailable":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["evals_unavailable","authentication_failed"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"Evals are unavailable right now, or the API key lookup failed. The `retry-after` header gives the seconds to wait."},"NewExperiment":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"datasetVersion":{"type":"integer"},"itemsTotal":{"type":"integer","description":"Items times runs per item."},"url":{"type":"string","description":"The experiment page."}},"required":["id","name","datasetVersion","itemsTotal","url"],"additionalProperties":false,"description":"The experiment, running."},"InvalidEvalsBody":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","invalid_body","decompression_failed"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The body is not JSON of the right shape, its text holds U+0000 or a lone surrogate, or its gzip does not decompress."},"EvalsWriteRefused":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["insufficient_scope","project_not_accepting_telemetry"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The API key does not have the scope that the endpoint names (on the API keys page, its Access does not have Run experiments), or Accept telemetry is off in the settings of its project."},"ExperimentDatasetNotFound":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["dataset_not_found","version_not_found"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The project has no dataset of this name, or the dataset has no such version."},"ExperimentNameTaken":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["experiment_name_taken"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The name and the next free numbers after it are taken."},"EvalsBodyTooLarge":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["body_too_large"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The body is over the limit of the endpoint, before or after gzip."},"EvalsUnsupportedEncoding":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["unsupported_encoding"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"Content-Encoding is not gzip or identity."},"ExperimentNotStarted":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["dataset_empty","evaluator_not_found","evaluator_not_supported"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The dataset version has no items, or an evaluator is missing or is not an LLM judge, a code check, or a rule."},"EvalsWriteRefusedByLimit":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["rate_limited","quota_exceeded"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"Too many requests for the project (`rate_limited`), or the write would take the workspace past a monthly cap of its plan (`quota_exceeded`): the ingestion units of Free, or the Evals text of any plan. The `retry-after` header gives the seconds to wait, which for a monthly cap is the start of next month. A lifetime gift budget that ran out has no `retry-after`."},"EvalsWriteServerError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_error","privacy_configuration_invalid"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The server failed to answer, or the privacy settings of the project are not valid."},"ExperimentItemsAccepted":{"type":"object","properties":{"accepted":{"type":"integer","description":"Runs that the request added."},"duplicates":{"type":"integer","description":"Runs that the experiment had. They keep their first post."}},"required":["accepted","duplicates"],"additionalProperties":false},"ExperimentNotFound":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["experiment_not_found"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The project has no experiment with this id."},"ExperimentNotOpen":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["experiment_ended","experiment_not_code"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The experiment ended, or it runs a prompt version."},"ExperimentItemNotFound":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["item_not_found"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"An `itemId` is not an item of the dataset version and split of the experiment."},"CompletedExperiment":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","running","completed","failed","stopped"],"description":"`running` while the server scores the last runs. Then the experiment completes on its own."}},"required":["id","status"],"additionalProperties":false},"ExperimentNotCode":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"anyOf":[{"type":"string","enum":["experiment_not_code"]}]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"The experiment runs a prompt version."},"ExperimentResult":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["queued","running","completed","failed","stopped"]},"checkStatus":{"anyOf":[{"type":"string","enum":["passed","failed"]},{"type":"null"}],"description":"The check of the min scores, when the experiment completes with min scores."},"itemsTotal":{"type":"integer"},"itemsDone":{"type":"integer"},"itemsFailed":{"type":"integer"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the experiment failed."},"scores":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"anyOf":[{"type":"string","enum":["pass_fail","number","labels","a_b_tie","up_down"]},{"type":"null"}]},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The pass rate (0 to 1) of a pass/fail or up/down score, the mean of a number score, else null."},"passCount":{"type":"integer"},"failCount":{"type":"integer"},"baselineValue":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The value of the experiment that this one compares with. Null for a stopped or failed experiment, which ran only some items."},"delta":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The change from the baseline: whole points of a rate, one decimal of a mean. Null for a stopped or failed experiment."},"minScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"passed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Whether the score is at its min score. Null without a min score."},"itemsFailed":{"type":"integer","description":"The runs of the experiment that failed. They have no score, so `value` leaves them out."}},"required":["name","kind","value","passCount","failCount","baselineValue","delta","minScore","passed","itemsFailed"],"additionalProperties":false},"description":"The evaluators of the experiment in order, then the other score names, then the min scores that have no scores yet."},"url":{"type":"string","description":"The experiment page."}},"required":["id","name","status","checkStatus","itemsTotal","itemsDone","itemsFailed","error","scores","url"],"additionalProperties":false,"description":"An experiment and its scores."},"ScoreAccepted":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The id of the score."},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error detail."}},"required":["message"],"description":"The error object. A JSON response contains `{\"message\": \"...\"}`. A protobuf response contains a binary protobuf Status message. The Status `message` field contains the same human-readable detail."}},"securitySchemes":{"projectApiKey":{"description":"A project API key, `td_live_<random>`. A key applies to one environment or to all environments. Its Access on the API keys page of a project gives its scopes, and each operation names the scope that it needs. For a Claude Console OpenTelemetry destination, set the endpoint URL to `https://api.telemetry.dev` and add the request header `Authorization` with the value `Bearer <project API key>`.","type":"http","scheme":"Bearer"}},"headers":{"Retry-After":{"description":"The seconds to wait before you send the request again.","schema":{"type":"string"}}}},"security":[],"tags":[{"name":"Health","description":"Liveness checks."},{"name":"Telemetry","description":"OTLP/HTTP export of traces, logs, and metrics."},{"name":"Prompts","description":"Prompts that apps fetch with getPrompt."},{"name":"Datasets","description":"Datasets that experiments of your code run on."},{"name":"Experiments","description":"Experiments that run in your code and send their outputs."},{"name":"Scores","description":"Scores that apps send."}],"servers":[{"url":"https://api.telemetry.dev","description":"Production"},{"url":"https://ingest.telemetry.dev","description":"Production, the earlier name of the same host; it stays supported"}]}