{"openapi":"3.1.0","info":{"title":"PromptLayer (BYOK) API","version":"0.1.0","description":"PromptLayer (BYOK) lets an AI assistant read your own PromptLayer data through the PromptLayer API with a key you supply (PromptLayer API key). Read-only: 11 tools (list_prompt_templates, get_prompt_template, get_prompt_template_labels, get_request, get_trace, list_datasets, get_dataset_rows, list_evaluations, get_evaluation_score, list_workflows, list_tool_registries). The BYOK key travels with...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-promptlayer.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-promptlayer/docs"},"termsOfService":"https://connectorbay.com/byok-promptlayer/terms"},"servers":[{"url":"https://byok-promptlayer.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-promptlayer/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_prompt_templates":{"post":{"operationId":"list_prompt_templates","summary":"List prompt templates in the workspace (newest first) with their latest version number; filter by name, release label or","description":"List prompt templates in the workspace (newest first) with their latest version number; filter by name, release label or status. Use for \"Which prompt templates do I have in PromptLayer\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"},"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many results per page (1 to 100).","title":"Per Page"},"name":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only templates whose name contains this text (case-insensitive).","title":"Name"},"label":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Only templates having this release label, for example 'prod'; the version with that label is returned.","title":"Label"},"status":{"anyOf":[{"enum":["active","deleted","all"],"type":"string"},{"type":"null"}],"default":"active","description":"Which templates: active, deleted or all.","title":"Status"},"is_snippet":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True for snippets only, false to leave snippets out; omit for both.","title":"Is Snippet"},"sort_by":{"anyOf":[{"enum":["created_at","updated_at","name","id"],"type":"string"},{"type":"null"}],"default":null,"description":"Sort field: created_at, updated_at, name or id.","title":"Sort By"},"sort_order":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":"desc","description":"Sort direction: asc or desc.","title":"Sort Order"}},"title":"list_prompt_templatesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_prompt_template":{"post":{"operationId":"get_prompt_template","summary":"Get one prompt template's content (raw, without calling a model) by name or id, optionally for a version number or relea","description":"Get one prompt template's content (raw, without calling a model) by name or id, optionally for a version number or release label. Use for \"Show the production version of the PromptLayer prompt 'support-reply'\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"identifier":{"description":"Prompt template name or numeric id.","maxLength":200,"title":"Identifier","type":"string"},"version":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Version number to read; omit for the latest.","title":"Version"},"label":{"anyOf":[{"maxLength":60,"type":"string"},{"type":"null"}],"default":null,"description":"Release label to read, for example 'prod' (use instead of version).","title":"Label"},"include_llm_kwargs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to include the model settings stored with the version.","title":"Include Llm Kwargs"}},"required":["identifier"],"title":"get_prompt_templateArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_prompt_template_labels":{"post":{"operationId":"get_prompt_template_labels","summary":"List the release labels (for example prod, staging) of a prompt template and the version each label points to. Use for \"","description":"List the release labels (for example prod, staging) of a prompt template and the version each label points to. Use for \"Which version of PromptLayer prompt 'support-reply' is labelled prod\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"identifier":{"description":"Prompt template name or numeric id.","maxLength":200,"title":"Identifier","type":"string"}},"required":["identifier"],"title":"get_prompt_template_labelsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_request":{"post":{"operationId":"get_request","summary":"Get one logged LLM request by id: prompt blueprint, provider, model, token counts, price, latency and trace id. Use for ","description":"Get one logged LLM request by id: prompt blueprint, provider, model, token counts, price, latency and trace id. Use for \"Show PromptLayer request 12345\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"request_id":{"description":"Numeric id of the logged request.","title":"Request Id","type":"integer"}},"required":["request_id"],"title":"get_requestArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_trace":{"post":{"operationId":"get_trace","summary":"Get all spans of one trace by trace id. Use for \"Show the spans of PromptLayer trace 0af7651916cd43dd8448eb211c80319c\".","description":"Get all spans of one trace by trace id. Use for \"Show the spans of PromptLayer trace 0af7651916cd43dd8448eb211c80319c\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"trace_id":{"description":"Trace id, for example from get_request.","maxLength":200,"title":"Trace Id","type":"string"}},"required":["trace_id"],"title":"get_traceArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_datasets":{"post":{"operationId":"list_datasets","summary":"List dataset versions with column names, filter settings and the dataset group they belong to. Use for \"Which datasets e","description":"List dataset versions with column names, filter settings and the dataset group they belong to. Use for \"Which datasets exist in my PromptLayer workspace\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"},"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many results per page (1 to 100).","title":"Per Page"},"name":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only datasets whose group name contains this text (case-insensitive).","title":"Name"},"status":{"anyOf":[{"enum":["active","deleted","all"],"type":"string"},{"type":"null"}],"default":"active","description":"Which datasets: active, deleted or all.","title":"Status"},"sort_by":{"anyOf":[{"enum":["created_at","updated_at","name","id"],"type":"string"},{"type":"null"}],"default":null,"description":"Sort field: created_at, updated_at, name or id.","title":"Sort By"},"sort_order":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":"desc","description":"Sort direction: asc or desc.","title":"Sort Order"}},"title":"list_datasetsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_dataset_rows":{"post":{"operationId":"get_dataset_rows","summary":"Read rows of one dataset version with its column names; supports search text and paging. Use for \"Show the first rows of","description":"Read rows of one dataset version with its column names; supports search text and paging. Use for \"Show the first rows of PromptLayer dataset 77\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"dataset_id":{"description":"Numeric dataset id from list_datasets.","title":"Dataset Id","type":"integer"},"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"},"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many results per page (1 to 100).","title":"Per Page"},"q":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only rows matching this search text.","title":"Q"}},"required":["dataset_id"],"title":"get_dataset_rowsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_evaluations":{"post":{"operationId":"list_evaluations","summary":"List evaluation pipelines with dataset, folder, tags and creation time; optionally nest their batch runs. Use for \"Which","description":"List evaluation pipelines with dataset, folder, tags and creation time; optionally nest their batch runs. Use for \"Which evaluations have I created in PromptLayer\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"},"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many results per page (1 to 100).","title":"Per Page"},"name":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only evaluations whose name contains this text (case-insensitive).","title":"Name"},"status":{"anyOf":[{"enum":["active","deleted","all"],"type":"string"},{"type":"null"}],"default":"active","description":"Which evaluations: active, deleted or all.","title":"Status"},"include_runs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to nest each evaluation's batch runs (can be large).","title":"Include Runs"},"sort_by":{"anyOf":[{"enum":["created_at","updated_at","name","id"],"type":"string"},{"type":"null"}],"default":null,"description":"Sort field: created_at, updated_at, name or id.","title":"Sort By"},"sort_order":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":"desc","description":"Sort direction: asc or desc.","title":"Sort Order"}},"title":"list_evaluationsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_evaluation_score":{"post":{"operationId":"get_evaluation_score","summary":"Get the overall score of one evaluation report with its score type and details. Use for \"What is the score of PromptLaye","description":"Get the overall score of one evaluation report with its score type and details. Use for \"What is the score of PromptLayer evaluation 321\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"report_id":{"description":"Numeric evaluation (report) id from list_evaluations.","title":"Report Id","type":"integer"}},"required":["report_id"],"title":"get_evaluation_scoreArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_workflows":{"post":{"operationId":"list_workflows","summary":"List agents (workflows) with their latest version number and release labels. Use for \"Which PromptLayer agents do I have","description":"List agents (workflows) with their latest version number and release labels. Use for \"Which PromptLayer agents do I have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"page":{"anyOf":[{"maximum":10000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"},"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":30,"description":"How many results per page (1 to 100).","title":"Per Page"},"sort_by":{"anyOf":[{"enum":["created_at","updated_at","name","id"],"type":"string"},{"type":"null"}],"default":null,"description":"Sort field: created_at, updated_at, name or id.","title":"Sort By"},"sort_order":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":"desc","description":"Sort direction: asc or desc.","title":"Sort Order"}},"title":"list_workflowsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_tool_registries":{"post":{"operationId":"list_tool_registries","summary":"List tool registries (shared function definitions) with name, description and folder. Use for \"Which tool registries are","description":"List tool registries (shared function definitions) with name, description and folder. Use for \"Which tool registries are saved in PromptLayer\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"sort_by":{"anyOf":[{"enum":["created_at","updated_at","name","id"],"type":"string"},{"type":"null"}],"default":null,"description":"Sort field: created_at, updated_at, name or id.","title":"Sort By"},"sort_order":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":"desc","description":"Sort direction: asc or desc.","title":"Sort Order"}},"title":"list_tool_registriesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}