{ "openapi": "3.1.1", "info": { "version": "1.0.0", "title": "Braintrust API", "description": "API specification for the backend data server. The API is hosted globally at\nhttps://api.braintrust.dev or in your own environment.\n\nYou can access the OpenAPI spec for this API at https://github.com/braintrustdata/braintrust-openapi.", "license": { "name": "Apache 2.0" } }, "servers": [ { "url": "https://api.braintrust.dev" } ], "security": [ { "bearerAuth": [] }, {} ], "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "API key or JWT", "description": "Most Braintrust endpoints are authenticated by providing your API key as a header `Authorization: Bearer [api_key]` to your HTTP request. You can create an API key in the Braintrust [organization settings page](https://www.braintrustdata.com/app/settings?subroute=api-keys)." } }, "schemas": { "ProjectIdParam": { "type": "string", "format": "uuid", "description": "Project id" }, "ExperimentIdParam": { "type": "string", "format": "uuid", "description": "Experiment id" }, "DatasetIdParam": { "type": "string", "format": "uuid", "description": "Dataset id" }, "PromptIdParam": { "type": "string", "format": "uuid", "description": "Prompt id" }, "PromptSessionIdParam": { "type": "string", "format": "uuid", "description": "PromptSession id" }, "RoleIdParam": { "type": "string", "format": "uuid", "description": "Role id" }, "GroupIdParam": { "type": "string", "format": "uuid", "description": "Group id" }, "AclIdParam": { "type": "string", "format": "uuid", "description": "Acl id" }, "UserIdParam": { "type": "string", "format": "uuid", "description": "User id" }, "ProjectAutomationIdParam": { "type": "string", "format": "uuid", "description": "ProjectAutomation id" }, "ProjectScoreIdParam": { "type": "string", "format": "uuid", "description": "ProjectScore id" }, "ProjectTagIdParam": { "type": "string", "format": "uuid", "description": "ProjectTag id" }, "SpanIframeIdParam": { "type": "string", "format": "uuid", "description": "SpanIframe id" }, "FunctionIdParam": { "type": "string", "format": "uuid", "description": "Function id" }, "ViewIdParam": { "type": "string", "format": "uuid", "description": "View id" }, "OrganizationIdParam": { "type": "string", "format": "uuid", "description": "Organization id" }, "ApiKeyIdParam": { "type": "string", "format": "uuid", "description": "ApiKey id" }, "ServiceTokenIdParam": { "type": "string", "format": "uuid", "description": "ServiceToken id" }, "AiSecretIdParam": { "type": "string", "format": "uuid", "description": "AiSecret id" }, "EnvVarIdParam": { "type": "string", "format": "uuid", "description": "EnvVar id" }, "McpServerIdParam": { "type": "string", "format": "uuid", "description": "McpServer id" }, "DatasetSnapshotIdParam": { "type": "string", "format": "uuid", "description": "DatasetSnapshot id" }, "ProjectIdQuery": { "type": "string", "format": "uuid", "description": "Project id" }, "ProjectName": { "type": "string", "description": "Name of the project to search for" }, "ExperimentName": { "type": "string", "description": "Name of the experiment to search for" }, "DatasetName": { "type": "string", "description": "Name of the dataset to search for" }, "PromptName": { "type": "string", "description": "Name of the prompt to search for" }, "PromptSessionName": { "type": "string", "description": "Name of the prompt_session to search for" }, "RoleName": { "type": "string", "description": "Name of the role to search for" }, "GroupName": { "type": "string", "description": "Name of the group to search for" }, "ProjectAutomationName": { "type": "string", "description": "Name of the project_automation to search for" }, "ProjectScoreName": { "type": "string", "description": "Name of the project_score to search for" }, "ProjectTagName": { "type": "string", "description": "Name of the project_tag to search for" }, "SpanIframeName": { "type": "string", "description": "Name of the span_iframe to search for" }, "FunctionName": { "type": "string", "description": "Name of the function to search for" }, "ViewName": { "type": "string", "description": "Name of the view to search for" }, "ApiKeyName": { "type": "string", "description": "Name of the api_key to search for" }, "ServiceTokenName": { "type": "string", "description": "Name of the service_token to search for" }, "AiSecretName": { "type": "string", "description": "Name of the ai_secret to search for" }, "EnvVarName": { "type": "string", "description": "Name of the env_var to search for" }, "McpServerName": { "type": "string", "description": "Name of the mcp_server to search for" }, "DatasetSnapshotName": { "type": "string", "description": "Name of the dataset_snapshot to search for" }, "OrgName": { "type": "string", "description": "Filter search results to within a particular organization" }, "Ids": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "array", "items": { "type": "string", "format": "uuid" } } ], "description": "Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times" }, "AppLimitParam": { "type": "integer", "nullable": true, "minimum": 0, "description": "Limit the number of objects to return" }, "AppLimitWithDefaultParam": { "type": "integer", "nullable": true, "minimum": 0, "default": 1000, "description": "Limit the number of objects to return" }, "FetchLimitParam": { "type": "integer", "nullable": true, "minimum": 0, "description": "limit the number of traces fetched\n\nFetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.\n\nThe `limit` parameter controls the number of full traces to return. So you may end up with more individual rows than the specified limit if you are fetching events containing traces." }, "StartingAfter": { "type": "string", "format": "uuid", "description": "Pagination cursor id.\n\nFor example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before`" }, "EndingBefore": { "type": "string", "format": "uuid", "description": "Pagination cursor id.\n\nFor example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before`" }, "MaxXactId": { "type": "string", "description": "DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.\n\nTogether, `max_xact_id` and `max_root_span_id` form a pagination cursor\n\nSince a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries." }, "MaxRootSpanId": { "type": "string", "description": "DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.\n\nTogether, `max_xact_id` and `max_root_span_id` form a pagination cursor\n\nSince a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries." }, "Version": { "type": "string", "description": "Retrieve a snapshot of events from a past time\n\nThe version id is essentially a filter on the latest event transaction id. You can use the `max_xact_id` returned by a past fetch as the version to reproduce that exact fetch." }, "PromptVersion": { "type": "string", "description": "Retrieve prompt at a specific version.\n\nThe version id can either be a transaction id (e.g. '1000192656880881099') or a version identifier (e.g. '81cd05ee665fdfb3')." }, "PromptEnvironment": { "type": "string", "description": "Filter by environment slug. Cannot be used together with `version`.\n\nFor `GET /v1/prompt`, environment resolution currently requires the request to match a single prompt. If multiple prompts match, the endpoint returns `400` (for example when `limit=1` is not set). Use `limit=1` or other filters (for example `slug`, `project_id`) to narrow results." }, "SummarizeScores": { "type": "boolean", "nullable": true, "description": "Whether to summarize the scores and metrics. If false (or omitted), only the metadata will be returned." }, "ComparisonExperimentId": { "type": "string", "format": "uuid", "description": "The experiment to compare against, if summarizing scores and metrics. If omitted, will fall back to the `base_exp_id` stored in the experiment metadata, and then to the most recent experiment run in the same project. Must pass `summarize_scores=true` for this id to be used" }, "SummarizeData": { "type": "boolean", "nullable": true, "description": "Whether to summarize the data. If false (or omitted), only the metadata will be returned." }, "Slug": { "type": "string", "description": "Retrieve prompt with a specific slug" }, "ViewType": { "type": "string", "enum": [ "projects", "experiments", "experiment", "playgrounds", "playground", "datasets", "dataset", "prompts", "parameters", "tools", "scorers", "classifiers", "logs", "monitor", "for_review_project_log", "for_review_experiments", "for_review_datasets", null ], "description": "Type of object that the view corresponds to." }, "UserGivenName": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Given name of the user to search for. You may pass the param multiple times to filter for more than one given name" }, "UserFamilyName": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Family name of the user to search for. You may pass the param multiple times to filter for more than one family name" }, "UserEmail": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Email of the user to search for. You may pass the param multiple times to filter for more than one email" }, "AclObjectType": { "type": "string", "enum": [ "organization", "project", "experiment", "dataset", "prompt", "prompt_session", "group", "role", "org_member", "project_log", "org_project" ], "description": "The object type that the ACL applies to" }, "AclObjectId": { "type": "string", "format": "uuid", "description": "The id of the object the ACL applies to" }, "AclListOrgObjectType": { "type": "string", "enum": [ "organization", "project", "experiment", "dataset", "prompt", "prompt_session", "group", "role", "org_member", "project_log", "org_project" ], "description": "The object type that the ACL applies to" }, "AclListOrgObjectId": { "type": "string", "format": "uuid", "description": "The id of the object the ACL applies to" }, "AclListUserId": { "type": "string", "format": "uuid", "description": "Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will be provided" }, "AclListGroupId": { "type": "string", "format": "uuid", "description": "Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will be provided" }, "AclListPermission": { "type": "string", "enum": [ "create", "read", "update", "delete", "create_acls", "read_acls", "update_acls", "delete_acls" ], "description": "Each permission permits a certain type of operation on an object in the system\n\nPermissions can be assigned to to objects on an individual basis, or grouped into roles" }, "AclListRestrictObjectType": { "type": "string", "enum": [ "organization", "project", "experiment", "dataset", "prompt", "prompt_session", "group", "role", "org_member", "project_log", "org_project" ], "description": "The object type that the ACL applies to" }, "AclListRoleId": { "type": "string", "format": "uuid", "description": "Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be provided" }, "ProjectScoreType": { "type": "string", "enum": [ "slider", "categorical", "weighted", "minimum", "maximum", "online", "free-form" ], "description": "The type of the configured score", "title": "project_score_type_single" }, "AISecretType": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "EnvVarObjectType": { "type": "string", "enum": [ "organization", "project", "function" ], "description": "The type of the object the environment variable is scoped for" }, "EnvVarObjectId": { "type": "string", "format": "uuid", "description": "The id of the object the environment variable is scoped for" }, "FunctionTypeEnum": { "type": "string", "enum": [ "llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox", null ], "default": "scorer", "description": "The type of global function. Defaults to 'scorer'." }, "NullableSavedFunctionId": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "function" ] }, "id": { "type": "string" }, "version": { "type": "string", "description": "The version of the function" } }, "required": [ "type", "id" ], "title": "function" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "global" ] }, "name": { "type": "string" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" } }, "required": [ "type", "name" ], "title": "global" }, { "type": "null" } ], "description": "Default preprocessor for this project. When set, functions that use preprocessors will use this instead of their built-in default." }, "ProjectSettings": { "type": "object", "nullable": true, "properties": { "comparison_key": { "type": "string", "nullable": true, "description": "The key used to join two experiments (defaults to `input`)" }, "baseline_experiment_id": { "type": "string", "nullable": true, "format": "uuid", "description": "The id of the experiment to use as the default baseline for comparisons" }, "spanFieldOrder": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "object_type": { "type": "string" }, "column_id": { "type": "string" }, "position": { "type": "string" }, "layout": { "anyOf": [ { "type": "string", "enum": [ "full" ] }, { "type": "string", "enum": [ "two_column" ] }, { "type": "null" } ] } }, "required": [ "object_type", "column_id", "position" ] }, "description": "The order of the fields to display in the trace view" }, "remote_eval_sources": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "url": { "type": "string" }, "name": { "type": "string", "nullable": true }, "description": { "type": "string", "nullable": true } }, "required": [ "url" ] }, "description": "The remote eval sources to use for the project" }, "disable_realtime_queries": { "type": "boolean", "nullable": true, "description": "If true, disable real-time queries for this project. This can improve query performance for high-volume logs." }, "default_preprocessor": { "$ref": "#/components/schemas/NullableSavedFunctionId" } } }, "Project": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project" }, "org_id": { "type": "string", "format": "uuid", "description": "Unique id for the organization that the project belongs under" }, "name": { "type": "string", "description": "Name of the project" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the project" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of project creation" }, "deleted_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of project deletion, or null if the project is still active" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifies the user who created the project" }, "settings": { "$ref": "#/components/schemas/ProjectSettings" } }, "required": [ "id", "org_id", "name" ] }, "CreateProject": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "Name of the project" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the project" }, "org_name": { "type": "string", "nullable": true, "description": "For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, you may specify the name of the organization the project belongs in." } }, "required": [ "name" ] }, "PatchProject": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the project" }, "description": { "type": "string", "nullable": true }, "user_id": { "type": "string", "nullable": true }, "settings": { "allOf": [ { "$ref": "#/components/schemas/ProjectSettings" }, { "description": "Project settings. Patch operations replace all settings, so make sure you include all settings you want to keep." } ] } } }, "InsertEventsResponse": { "type": "object", "properties": { "row_ids": { "type": "array", "items": { "type": "string" }, "description": "The ids of all rows that were inserted, aligning one-to-one with the rows provided as input" } }, "required": [ "row_ids" ] }, "SpanType": { "type": "string", "nullable": true, "enum": [ "llm", "score", "function", "eval", "task", "tool", "automation", "facet", "preprocessor", "classifier", "review", null ], "description": "Type of the span, for display purposes only" }, "SpanAttributes": { "type": "object", "nullable": true, "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the span, for display purposes only" }, "type": { "$ref": "#/components/schemas/SpanType" }, "purpose": { "type": "string", "nullable": true, "enum": [ "scorer", null ], "description": "A special value that indicates the span was generated by a scoring automation" } }, "additionalProperties": { "nullable": true }, "description": "Human-identifying attributes of the span, such as name, type, etc." }, "ObjectReferenceNullish": { "type": "object", "nullable": true, "properties": { "object_type": { "type": "string", "enum": [ "project_logs", "experiment", "dataset", "prompt", "function", "prompt_session" ], "description": "Type of the object the event is originating from." }, "object_id": { "type": "string", "format": "uuid", "description": "ID of the object the event is originating from." }, "id": { "type": "string", "description": "ID of the original event." }, "_xact_id": { "type": "string", "nullable": true, "description": "Transaction ID of the original event." }, "created": { "type": "string", "nullable": true, "description": "Created timestamp of the original event. Used to help sort in the UI" } }, "required": [ "object_type", "object_id", "id" ], "description": "Indicates the event was copied from another object." }, "InsertProjectLogsEvent": { "type": "object", "properties": { "input": { "nullable": true, "description": "The arguments that uniquely define a user input (an arbitrary, JSON serializable object)." }, "output": { "nullable": true, "description": "The output of your application, including post-processing (an arbitrary, JSON serializable object), that allows you to determine whether the result is correct or not. For example, in an app that generates SQL queries, the `output` should be the _result_ of the SQL query generated by the model, not the query itself, because there may be multiple valid queries that answer a single question." }, "expected": { "nullable": true, "description": "The ground truth value (an arbitrary, JSON serializable object) that you'd compare to `output` to determine if your `output` value is correct or not. Braintrust currently does not compare `output` to `expected` for you, since there are so many different ways to do that correctly. Instead, these values are just used to help you navigate while digging into analyses. However, we may later use these values to re-score outputs or fine-tune your models." }, "error": { "nullable": true, "description": "The error that occurred, if any." }, "scores": { "type": "object", "nullable": true, "additionalProperties": { "type": "number", "nullable": true, "minimum": 0, "maximum": 1 }, "description": "A dictionary of numeric values (between 0 and 1) to log. The scores should give you a variety of signals that help you determine how accurate the outputs are compared to what you expect and diagnose failures. For example, a summarization app might have one score that tells you how accurate the summary is, and another that measures the word similarity between the generated and grouth truth summary. The word similarity score could help you determine whether the summarization was covering similar concepts or not. You can use these scores to help you sort, filter, and compare logs." }, "metadata": { "type": "object", "nullable": true, "properties": { "model": { "type": "string", "nullable": true, "description": "The model used for this example" } }, "additionalProperties": { "nullable": true }, "description": "A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags to log" }, "metrics": { "type": "object", "nullable": true, "properties": { "start": { "type": "number", "nullable": true, "description": "A unix timestamp recording when the section of code which produced the project logs event started" }, "end": { "type": "number", "nullable": true, "description": "A unix timestamp recording when the section of code which produced the project logs event finished" }, "prompt_tokens": { "type": "integer", "nullable": true, "description": "The number of tokens in the prompt used to generate the project logs event (only set if this is an LLM span)" }, "completion_tokens": { "type": "integer", "nullable": true, "description": "The number of tokens in the completion generated by the model (only set if this is an LLM span)" }, "tokens": { "type": "integer", "nullable": true, "description": "The total number of tokens in the input and output of the project logs event." }, "caller_functionname": { "nullable": true, "description": "This metric is deprecated" }, "caller_filename": { "nullable": true, "description": "This metric is deprecated" }, "caller_lineno": { "nullable": true, "description": "This metric is deprecated" } }, "additionalProperties": { "type": "number" }, "description": "Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use \"start\" and \"end\" to track the time span over which the project logs event was produced" }, "context": { "type": "object", "nullable": true, "properties": { "caller_functionname": { "type": "string", "nullable": true, "description": "The function in code which created the project logs event" }, "caller_filename": { "type": "string", "nullable": true, "description": "Name of the file in code where the project logs event was created" }, "caller_lineno": { "type": "integer", "nullable": true, "description": "Line of code where the project logs event was created" } }, "additionalProperties": { "nullable": true }, "description": "Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event" }, "span_attributes": { "$ref": "#/components/schemas/SpanAttributes" }, "id": { "type": "string", "nullable": true, "description": "A unique identifier for the project logs event. If you don't provide one, Braintrust will generate one for you" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "The timestamp the project logs event was created" }, "origin": { "$ref": "#/components/schemas/ObjectReferenceNullish" }, "facets": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Facets for categorization (dictionary from facet id to value)" }, "_object_delete": { "type": "boolean", "nullable": true, "description": "Pass `_object_delete=true` to mark the project logs event deleted. Deleted events will not show up in subsequent fetches for this project logs" }, "_is_merge": { "type": "boolean", "nullable": true, "description": "The `_is_merge` field controls how the row is merged with any existing row with the same id in the DB. By default (or when set to `false`), the existing row is completely replaced by the new row. When set to `true`, the new row is deep-merged into the existing row, if one is found. If no existing row is found, the new row is inserted as is.\n\nFor example, say there is an existing row in the DB `{\"id\": \"foo\", \"input\": {\"a\": 5, \"b\": 10}}`. If we merge a new row as `{\"_is_merge\": true, \"id\": \"foo\", \"input\": {\"b\": 11, \"c\": 20}}`, the new row will be `{\"id\": \"foo\", \"input\": {\"a\": 5, \"b\": 11, \"c\": 20}}`. If we replace the new row as `{\"id\": \"foo\", \"input\": {\"b\": 11, \"c\": 20}}`, the new row will be `{\"id\": \"foo\", \"input\": {\"b\": 11, \"c\": 20}}`" }, "_merge_paths": { "type": "array", "nullable": true, "items": { "type": "array", "items": { "type": "string" } }, "description": "The `_merge_paths` field allows controlling the depth of the merge, when `_is_merge=true`. `_merge_paths` is a list of paths, where each path is a list of field names. The deep merge will not descend below any of the specified merge paths.\n\nFor example, say there is an existing row in the DB `{\"id\": \"foo\", \"input\": {\"a\": {\"b\": 10}, \"c\": {\"d\": 20}}, \"output\": {\"a\": 20}}`. If we merge a new row as `{\"_is_merge\": true, \"_merge_paths\": [[\"input\", \"a\"], [\"output\"]], \"input\": {\"a\": {\"q\": 30}, \"c\": {\"e\": 30}, \"bar\": \"baz\"}, \"output\": {\"d\": 40}}`, the new row will be `{\"id\": \"foo\": \"input\": {\"a\": {\"q\": 30}, \"c\": {\"d\": 20, \"e\": 30}, \"bar\": \"baz\"}, \"output\": {\"d\": 40}}`. In this case, due to the merge paths, we have replaced `input.a` and `output`, but have still deep-merged `input` and `input.c`." }, "_array_delete": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "path": { "type": "array", "items": { "type": "string" } }, "delete": { "type": "array", "items": { "nullable": true } } }, "required": [ "path", "delete" ] }, "description": "The `_array_delete` field allows removing specific values from array fields. It is an array of objects with `path` and `delete` properties.\n\nFor example, to remove tags \"foo\" and \"bar\" from an existing row: `{\"_is_merge\": true, \"_array_delete\": [{\"path\": [\"tags\"], \"delete\": [\"foo\", \"bar\"]}]}`. For nested fields like `metadata.categories`, use `[{\"path\": [\"metadata\", \"categories\"], \"delete\": [\"value\"]}]`. This will remove those specific values from the array while preserving others." }, "_parent_id": { "type": "string", "nullable": true, "description": "DEPRECATED: The `_parent_id` field is deprecated and should not be used. Support for `_parent_id` will be dropped in a future version of Braintrust. Log `span_id`, `root_span_id`, and `span_parents` explicitly instead.\n\nUse the `_parent_id` field to create this row as a subspan of an existing row. Tracking hierarchical relationships are important for tracing (see the [guide](https://www.braintrust.dev/docs/instrument) for full details).\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"_parent_id\": \"abc\", \"id\": \"llm_call\", \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." }, "span_id": { "type": "string", "nullable": true, "description": "Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the [guide](https://www.braintrust.dev/docs/instrument) for full details.\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"span_id\": \"span0\", \"root_span_id\": \"root_span0\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"id\": \"llm_call\", \"span_id\": \"span1\", \"root_span_id\": \"root_span0\", \"span_parents\": [\"span0\"], \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." }, "root_span_id": { "type": "string", "nullable": true, "description": "Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the [guide](https://www.braintrust.dev/docs/instrument) for full details.\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"span_id\": \"span0\", \"root_span_id\": \"root_span0\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"id\": \"llm_call\", \"span_id\": \"span1\", \"root_span_id\": \"root_span0\", \"span_parents\": [\"span0\"], \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." }, "span_parents": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the [guide](https://www.braintrust.dev/docs/instrument) for full details.\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"span_id\": \"span0\", \"root_span_id\": \"root_span0\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"id\": \"llm_call\", \"span_id\": \"span1\", \"root_span_id\": \"root_span0\", \"span_parents\": [\"span0\"], \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." } }, "description": "A project logs event" }, "InsertProjectLogsEventRequest": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/InsertProjectLogsEvent" }, "description": "A list of project logs events to insert" } }, "required": [ "events" ] }, "SavedFunctionId": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "function" ] }, "id": { "type": "string" }, "version": { "type": "string", "description": "The version of the function" } }, "required": [ "type", "id" ], "title": "function" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "global" ] }, "name": { "type": "string" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" } }, "required": [ "type", "name" ], "title": "global" }, { "type": "null" } ], "description": "Optional function identifier that produced the classification" }, "ProjectLogsEvent": { "type": "object", "properties": { "id": { "type": "string", "description": "A unique identifier for the project logs event. If you don't provide one, Braintrust will generate one for you" }, "_xact_id": { "type": "string", "description": "The transaction id of an event is unique to the network operation that processed the event insertion. Transaction ids are monotonically increasing over time and can be used to retrieve a versioned snapshot of the project logs (see the `version` parameter)" }, "_pagination_key": { "type": "string", "nullable": true, "description": "A stable, time-ordered key that can be used to paginate over project logs events. This field is auto-generated by Braintrust and only exists in Brainstore." }, "created": { "type": "string", "format": "date-time", "description": "The timestamp the project logs event was created" }, "org_id": { "type": "string", "format": "uuid", "description": "Unique id for the organization that the project belongs under" }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project" }, "log_id": { "type": "string", "enum": [ "g" ], "description": "A literal 'g' which identifies the log as a project log" }, "input": { "nullable": true, "description": "The arguments that uniquely define a user input (an arbitrary, JSON serializable object)." }, "output": { "nullable": true, "description": "The output of your application, including post-processing (an arbitrary, JSON serializable object), that allows you to determine whether the result is correct or not. For example, in an app that generates SQL queries, the `output` should be the _result_ of the SQL query generated by the model, not the query itself, because there may be multiple valid queries that answer a single question." }, "expected": { "nullable": true, "description": "The ground truth value (an arbitrary, JSON serializable object) that you'd compare to `output` to determine if your `output` value is correct or not. Braintrust currently does not compare `output` to `expected` for you, since there are so many different ways to do that correctly. Instead, these values are just used to help you navigate while digging into analyses. However, we may later use these values to re-score outputs or fine-tune your models." }, "error": { "nullable": true, "description": "The error that occurred, if any." }, "scores": { "type": "object", "nullable": true, "additionalProperties": { "type": "number", "nullable": true, "minimum": 0, "maximum": 1 }, "description": "A dictionary of numeric values (between 0 and 1) to log. The scores should give you a variety of signals that help you determine how accurate the outputs are compared to what you expect and diagnose failures. For example, a summarization app might have one score that tells you how accurate the summary is, and another that measures the word similarity between the generated and grouth truth summary. The word similarity score could help you determine whether the summarization was covering similar concepts or not. You can use these scores to help you sort, filter, and compare logs." }, "metadata": { "type": "object", "nullable": true, "properties": { "model": { "type": "string", "nullable": true, "description": "The model used for this example" } }, "additionalProperties": { "nullable": true }, "description": "A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags to log" }, "metrics": { "type": "object", "nullable": true, "properties": { "start": { "type": "number", "nullable": true, "description": "A unix timestamp recording when the section of code which produced the project logs event started" }, "end": { "type": "number", "nullable": true, "description": "A unix timestamp recording when the section of code which produced the project logs event finished" }, "prompt_tokens": { "type": "integer", "nullable": true, "description": "The number of tokens in the prompt used to generate the project logs event (only set if this is an LLM span)" }, "completion_tokens": { "type": "integer", "nullable": true, "description": "The number of tokens in the completion generated by the model (only set if this is an LLM span)" }, "tokens": { "type": "integer", "nullable": true, "description": "The total number of tokens in the input and output of the project logs event." }, "caller_functionname": { "nullable": true, "description": "This metric is deprecated" }, "caller_filename": { "nullable": true, "description": "This metric is deprecated" }, "caller_lineno": { "nullable": true, "description": "This metric is deprecated" } }, "additionalProperties": { "type": "number" }, "description": "Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use \"start\" and \"end\" to track the time span over which the project logs event was produced" }, "context": { "type": "object", "nullable": true, "properties": { "caller_functionname": { "type": "string", "nullable": true, "description": "The function in code which created the project logs event" }, "caller_filename": { "type": "string", "nullable": true, "description": "Name of the file in code where the project logs event was created" }, "caller_lineno": { "type": "integer", "nullable": true, "description": "Line of code where the project logs event was created" } }, "additionalProperties": { "nullable": true }, "description": "Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the project logs event" }, "span_id": { "type": "string", "description": "A unique identifier used to link different project logs events together as part of a full trace. See the [tracing guide](https://www.braintrust.dev/docs/instrument) for full details on tracing" }, "span_parents": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "An array of the parent `span_ids` of this project logs event. This should be empty for the root span of a trace, and should most often contain just one parent element for subspans" }, "root_span_id": { "type": "string", "description": "A unique identifier for the trace this project logs event belongs to" }, "is_root": { "type": "boolean", "nullable": true, "description": "Whether this span is a root span" }, "span_attributes": { "$ref": "#/components/schemas/SpanAttributes" }, "origin": { "$ref": "#/components/schemas/ObjectReferenceNullish" }, "comments": { "type": "array", "nullable": true, "items": { "nullable": true }, "description": "Optional list of comments attached to this event" }, "audit_data": { "type": "array", "nullable": true, "items": { "nullable": true }, "description": "Optional list of audit entries attached to this event" }, "_async_scoring_state": { "nullable": true, "description": "The async scoring state for this event" }, "facets": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Facets for categorization (dictionary from facet id to value)" }, "classifications": { "type": "object", "nullable": true, "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stable classification identifier" }, "label": { "type": "string", "description": "Original label of the classification item, which is useful for search and indexing purposes" }, "confidence": { "type": "number", "nullable": true, "description": "Optional confidence score for the classification" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Optional metadata associated with the classification" }, "source": { "$ref": "#/components/schemas/SavedFunctionId" } }, "required": [ "id" ] } }, "description": "Classifications for this event (dictionary from classification name to items)" } }, "required": [ "id", "_xact_id", "created", "org_id", "project_id", "log_id", "span_id", "root_span_id" ] }, "FetchProjectLogsEventsResponse": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/ProjectLogsEvent" }, "description": "A list of fetched events" }, "cursor": { "type": "string", "nullable": true, "description": "Pagination cursor\n\nPass this string directly as the `cursor` param to your next fetch request to get the next page of results. Not provided if the returned result set is empty." } }, "required": [ "events" ] }, "FetchLimit": { "type": "integer", "nullable": true, "minimum": 0, "description": "limit the number of traces fetched\n\nFetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.\n\nThe `limit` parameter controls the number of full traces to return. So you may end up with more individual rows than the specified limit if you are fetching events containing traces." }, "FetchPaginationCursor": { "type": "string", "nullable": true, "description": "An opaque string to be used as a cursor for the next page of results, in order from latest to earliest.\n\nThe string can be obtained directly from the `cursor` property of the previous fetch query" }, "FetchEventsRequest": { "type": "object", "properties": { "limit": { "$ref": "#/components/schemas/FetchLimit" }, "cursor": { "$ref": "#/components/schemas/FetchPaginationCursor" }, "max_xact_id": { "$ref": "#/components/schemas/MaxXactId", "nullable": true }, "max_root_span_id": { "$ref": "#/components/schemas/MaxRootSpanId", "nullable": true }, "version": { "$ref": "#/components/schemas/Version", "nullable": true } } }, "FeedbackResponseSchema": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "success" ] } }, "required": [ "status" ] }, "FeedbackProjectLogsItem": { "type": "object", "properties": { "id": { "type": "string", "description": "The id of the project logs event to log feedback for. This is the row `id` returned by `POST /v1/project_logs/{project_id}/insert`" }, "scores": { "type": "object", "nullable": true, "additionalProperties": { "type": "number", "nullable": true, "minimum": 0, "maximum": 1 }, "description": "A dictionary of numeric values (between 0 and 1) to log. These scores will be merged into the existing scores for the project logs event" }, "expected": { "nullable": true, "description": "The ground truth value (an arbitrary, JSON serializable object) that you'd compare to `output` to determine if your `output` value is correct or not" }, "comment": { "type": "string", "nullable": true, "description": "An optional comment string to log about the project logs event" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "A dictionary with additional data about the feedback. If you have a `user_id`, you can log it here and access it in the Braintrust UI. Note, this metadata does not correspond to the main event itself, but rather the audit log attached to the event." }, "source": { "type": "string", "nullable": true, "enum": [ "app", "api", "external", null ], "description": "The source of the feedback. Must be one of \"external\" (default), \"app\", or \"api\"" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags to log" } }, "required": [ "id" ] }, "FeedbackProjectLogsEventRequest": { "type": "object", "properties": { "feedback": { "type": "array", "items": { "$ref": "#/components/schemas/FeedbackProjectLogsItem" }, "description": "A list of project logs feedback items" } }, "required": [ "feedback" ] }, "RepoInfo": { "type": "object", "nullable": true, "properties": { "commit": { "type": "string", "nullable": true, "description": "SHA of most recent commit" }, "branch": { "type": "string", "nullable": true, "description": "Name of the branch the most recent commit belongs to" }, "tag": { "type": "string", "nullable": true, "description": "Name of the tag on the most recent commit" }, "dirty": { "type": "boolean", "nullable": true, "description": "Whether or not the repo had uncommitted changes when snapshotted" }, "author_name": { "type": "string", "nullable": true, "description": "Name of the author of the most recent commit" }, "author_email": { "type": "string", "nullable": true, "description": "Email of the author of the most recent commit" }, "commit_message": { "type": "string", "nullable": true, "description": "Most recent commit message" }, "commit_time": { "type": "string", "nullable": true, "description": "Time of the most recent commit" }, "git_diff": { "type": "string", "nullable": true, "description": "If the repo was dirty when run, this includes the diff between the current state of the repo and the most recent commit." } }, "description": "Metadata about the state of the repo when the experiment was created" }, "Experiment": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the experiment" }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the experiment belongs under" }, "name": { "type": "string", "description": "Name of the experiment. Within a project, experiment names are unique" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the experiment" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of experiment creation" }, "repo_info": { "$ref": "#/components/schemas/RepoInfo" }, "commit": { "type": "string", "nullable": true, "description": "Commit, taken directly from `repo_info.commit`" }, "base_exp_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Id of default base experiment to compare against when viewing this experiment" }, "deleted_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of experiment deletion, or null if the experiment is still active" }, "dataset_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifier of the linked dataset, or null if the experiment is not linked to a dataset" }, "dataset_version": { "type": "string", "nullable": true, "description": "Version number of the linked dataset the experiment was run against. This can be used to reproduce the experiment after the dataset has been modified." }, "internal_metadata": { "type": "object", "nullable": true, "properties": { "dataset_filter": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "BTQL filter payload used to evaluate a subset of a linked dataset." } }, "additionalProperties": { "nullable": true }, "description": "Braintrust-controlled metadata about the experiment." }, "parameters_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifier of the linked saved parameters object, or null if the experiment is not linked to saved parameters" }, "parameters_version": { "type": "string", "nullable": true, "description": "Version number of the linked saved parameters object the experiment was run against." }, "public": { "type": "boolean", "description": "Whether or not the experiment is public. Public experiments can be viewed by anybody inside or outside the organization" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifies the user who created the experiment" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "User-controlled metadata about the experiment" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the experiment" } }, "required": [ "id", "project_id", "name", "public" ] }, "CreateExperiment": { "type": "object", "properties": { "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the experiment belongs under" }, "name": { "type": "string", "nullable": true, "minLength": 1, "description": "Name of the experiment. Within a project, experiment names are unique" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the experiment" }, "repo_info": { "$ref": "#/components/schemas/RepoInfo" }, "base_exp_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Id of default base experiment to compare against when viewing this experiment" }, "dataset_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifier of the linked dataset, or null if the experiment is not linked to a dataset" }, "dataset_version": { "type": "string", "nullable": true, "description": "Version number of the linked dataset the experiment was run against. This can be used to reproduce the experiment after the dataset has been modified." }, "internal_metadata": { "type": "object", "nullable": true, "properties": { "dataset_filter": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "BTQL filter payload used to evaluate a subset of a linked dataset." } }, "additionalProperties": { "nullable": true }, "description": "Braintrust-controlled metadata about the experiment." }, "parameters_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifier of the linked saved parameters object, or null if the experiment is not linked to saved parameters" }, "parameters_version": { "type": "string", "nullable": true, "description": "Version number of the linked saved parameters object the experiment was run against." }, "public": { "type": "boolean", "nullable": true, "description": "Whether or not the experiment is public. Public experiments can be viewed by anybody inside or outside the organization" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "User-controlled metadata about the experiment" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the experiment" }, "ensure_new": { "type": "boolean", "nullable": true, "description": "Normally, creating an experiment with the same name as an existing experiment will return the existing one un-modified. But if `ensure_new` is true, registration will generate a new experiment with a unique name in case of a conflict." } }, "required": [ "project_id" ] }, "PatchExperiment": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the experiment. Within a project, experiment names are unique" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the experiment" }, "repo_info": { "$ref": "#/components/schemas/RepoInfo" }, "base_exp_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Id of default base experiment to compare against when viewing this experiment" }, "dataset_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifier of the linked dataset, or null if the experiment is not linked to a dataset" }, "dataset_version": { "type": "string", "nullable": true, "description": "Version number of the linked dataset the experiment was run against. This can be used to reproduce the experiment after the dataset has been modified." }, "internal_metadata": { "type": "object", "nullable": true, "properties": { "dataset_filter": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "BTQL filter payload used to evaluate a subset of a linked dataset." } }, "additionalProperties": { "nullable": true }, "description": "Braintrust-controlled metadata about the experiment." }, "parameters_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifier of the linked saved parameters object, or null if the experiment is not linked to saved parameters" }, "parameters_version": { "type": "string", "nullable": true, "description": "Version number of the linked saved parameters object the experiment was run against." }, "public": { "type": "boolean", "nullable": true, "description": "Whether or not the experiment is public. Public experiments can be viewed by anybody inside or outside the organization" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "User-controlled metadata about the experiment" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the experiment" } } }, "InsertExperimentEvent": { "type": "object", "properties": { "input": { "nullable": true, "description": "The arguments that uniquely define a test case (an arbitrary, JSON serializable object). Later on, Braintrust will use the `input` to know whether two test cases are the same between experiments, so they should not contain experiment-specific state. A simple rule of thumb is that if you run the same experiment twice, the `input` should be identical" }, "output": { "nullable": true, "description": "The output of your application, including post-processing (an arbitrary, JSON serializable object), that allows you to determine whether the result is correct or not. For example, in an app that generates SQL queries, the `output` should be the _result_ of the SQL query generated by the model, not the query itself, because there may be multiple valid queries that answer a single question" }, "expected": { "nullable": true, "description": "The ground truth value (an arbitrary, JSON serializable object) that you'd compare to `output` to determine if your `output` value is correct or not. Braintrust currently does not compare `output` to `expected` for you, since there are so many different ways to do that correctly. Instead, these values are just used to help you navigate your experiments while digging into analyses. However, we may later use these values to re-score outputs or fine-tune your models" }, "error": { "nullable": true, "description": "The error that occurred, if any." }, "scores": { "type": "object", "nullable": true, "additionalProperties": { "type": "number", "nullable": true, "minimum": 0, "maximum": 1 }, "description": "A dictionary of numeric values (between 0 and 1) to log. The scores should give you a variety of signals that help you determine how accurate the outputs are compared to what you expect and diagnose failures. For example, a summarization app might have one score that tells you how accurate the summary is, and another that measures the word similarity between the generated and grouth truth summary. The word similarity score could help you determine whether the summarization was covering similar concepts or not. You can use these scores to help you sort, filter, and compare experiments" }, "metadata": { "type": "object", "nullable": true, "properties": { "model": { "type": "string", "nullable": true, "description": "The model used for this example" } }, "additionalProperties": { "nullable": true }, "description": "A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags to log" }, "metrics": { "type": "object", "nullable": true, "properties": { "start": { "type": "number", "nullable": true, "description": "A unix timestamp recording when the section of code which produced the experiment event started" }, "end": { "type": "number", "nullable": true, "description": "A unix timestamp recording when the section of code which produced the experiment event finished" }, "prompt_tokens": { "type": "integer", "nullable": true, "description": "The number of tokens in the prompt used to generate the experiment event (only set if this is an LLM span)" }, "completion_tokens": { "type": "integer", "nullable": true, "description": "The number of tokens in the completion generated by the model (only set if this is an LLM span)" }, "tokens": { "type": "integer", "nullable": true, "description": "The total number of tokens in the input and output of the experiment event." }, "caller_functionname": { "nullable": true, "description": "This metric is deprecated" }, "caller_filename": { "nullable": true, "description": "This metric is deprecated" }, "caller_lineno": { "nullable": true, "description": "This metric is deprecated" } }, "additionalProperties": { "type": "number" }, "description": "Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use \"start\" and \"end\" to track the time span over which the experiment event was produced" }, "context": { "type": "object", "nullable": true, "properties": { "caller_functionname": { "type": "string", "nullable": true, "description": "The function in code which created the experiment event" }, "caller_filename": { "type": "string", "nullable": true, "description": "Name of the file in code where the experiment event was created" }, "caller_lineno": { "type": "integer", "nullable": true, "description": "Line of code where the experiment event was created" } }, "additionalProperties": { "nullable": true }, "description": "Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event" }, "span_attributes": { "$ref": "#/components/schemas/SpanAttributes" }, "id": { "type": "string", "nullable": true, "description": "A unique identifier for the experiment event. If you don't provide one, Braintrust will generate one for you" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "The timestamp the experiment event was created" }, "origin": { "$ref": "#/components/schemas/ObjectReferenceNullish" }, "facets": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Facets for categorization (dictionary from facet id to value)" }, "_object_delete": { "type": "boolean", "nullable": true, "description": "Pass `_object_delete=true` to mark the experiment event deleted. Deleted events will not show up in subsequent fetches for this experiment" }, "_is_merge": { "type": "boolean", "nullable": true, "description": "The `_is_merge` field controls how the row is merged with any existing row with the same id in the DB. By default (or when set to `false`), the existing row is completely replaced by the new row. When set to `true`, the new row is deep-merged into the existing row, if one is found. If no existing row is found, the new row is inserted as is.\n\nFor example, say there is an existing row in the DB `{\"id\": \"foo\", \"input\": {\"a\": 5, \"b\": 10}}`. If we merge a new row as `{\"_is_merge\": true, \"id\": \"foo\", \"input\": {\"b\": 11, \"c\": 20}}`, the new row will be `{\"id\": \"foo\", \"input\": {\"a\": 5, \"b\": 11, \"c\": 20}}`. If we replace the new row as `{\"id\": \"foo\", \"input\": {\"b\": 11, \"c\": 20}}`, the new row will be `{\"id\": \"foo\", \"input\": {\"b\": 11, \"c\": 20}}`" }, "_merge_paths": { "type": "array", "nullable": true, "items": { "type": "array", "items": { "type": "string" } }, "description": "The `_merge_paths` field allows controlling the depth of the merge, when `_is_merge=true`. `_merge_paths` is a list of paths, where each path is a list of field names. The deep merge will not descend below any of the specified merge paths.\n\nFor example, say there is an existing row in the DB `{\"id\": \"foo\", \"input\": {\"a\": {\"b\": 10}, \"c\": {\"d\": 20}}, \"output\": {\"a\": 20}}`. If we merge a new row as `{\"_is_merge\": true, \"_merge_paths\": [[\"input\", \"a\"], [\"output\"]], \"input\": {\"a\": {\"q\": 30}, \"c\": {\"e\": 30}, \"bar\": \"baz\"}, \"output\": {\"d\": 40}}`, the new row will be `{\"id\": \"foo\": \"input\": {\"a\": {\"q\": 30}, \"c\": {\"d\": 20, \"e\": 30}, \"bar\": \"baz\"}, \"output\": {\"d\": 40}}`. In this case, due to the merge paths, we have replaced `input.a` and `output`, but have still deep-merged `input` and `input.c`." }, "_array_delete": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "path": { "type": "array", "items": { "type": "string" } }, "delete": { "type": "array", "items": { "nullable": true } } }, "required": [ "path", "delete" ] }, "description": "The `_array_delete` field allows removing specific values from array fields. It is an array of objects with `path` and `delete` properties.\n\nFor example, to remove tags \"foo\" and \"bar\" from an existing row: `{\"_is_merge\": true, \"_array_delete\": [{\"path\": [\"tags\"], \"delete\": [\"foo\", \"bar\"]}]}`. For nested fields like `metadata.categories`, use `[{\"path\": [\"metadata\", \"categories\"], \"delete\": [\"value\"]}]`. This will remove those specific values from the array while preserving others." }, "_parent_id": { "type": "string", "nullable": true, "description": "DEPRECATED: The `_parent_id` field is deprecated and should not be used. Support for `_parent_id` will be dropped in a future version of Braintrust. Log `span_id`, `root_span_id`, and `span_parents` explicitly instead.\n\nUse the `_parent_id` field to create this row as a subspan of an existing row. Tracking hierarchical relationships are important for tracing (see the [guide](https://www.braintrust.dev/docs/instrument) for full details).\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"_parent_id\": \"abc\", \"id\": \"llm_call\", \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." }, "span_id": { "type": "string", "nullable": true, "description": "Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the [guide](https://www.braintrust.dev/docs/instrument) for full details.\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"span_id\": \"span0\", \"root_span_id\": \"root_span0\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"id\": \"llm_call\", \"span_id\": \"span1\", \"root_span_id\": \"root_span0\", \"span_parents\": [\"span0\"], \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." }, "root_span_id": { "type": "string", "nullable": true, "description": "Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the [guide](https://www.braintrust.dev/docs/instrument) for full details.\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"span_id\": \"span0\", \"root_span_id\": \"root_span0\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"id\": \"llm_call\", \"span_id\": \"span1\", \"root_span_id\": \"root_span0\", \"span_parents\": [\"span0\"], \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." }, "span_parents": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the [guide](https://www.braintrust.dev/docs/instrument) for full details.\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"span_id\": \"span0\", \"root_span_id\": \"root_span0\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"id\": \"llm_call\", \"span_id\": \"span1\", \"root_span_id\": \"root_span0\", \"span_parents\": [\"span0\"], \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." } }, "description": "An experiment event" }, "InsertExperimentEventRequest": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/InsertExperimentEvent" }, "description": "A list of experiment events to insert" } }, "required": [ "events" ] }, "ExperimentEvent": { "type": "object", "properties": { "id": { "type": "string", "description": "A unique identifier for the experiment event. If you don't provide one, Braintrust will generate one for you" }, "_xact_id": { "type": "string", "description": "The transaction id of an event is unique to the network operation that processed the event insertion. Transaction ids are monotonically increasing over time and can be used to retrieve a versioned snapshot of the experiment (see the `version` parameter)" }, "created": { "type": "string", "format": "date-time", "description": "The timestamp the experiment event was created" }, "_pagination_key": { "type": "string", "nullable": true, "description": "A stable, time-ordered key that can be used to paginate over experiment events. This field is auto-generated by Braintrust and only exists in Brainstore." }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the experiment belongs under" }, "experiment_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the experiment" }, "input": { "nullable": true, "description": "The arguments that uniquely define a test case (an arbitrary, JSON serializable object). Later on, Braintrust will use the `input` to know whether two test cases are the same between experiments, so they should not contain experiment-specific state. A simple rule of thumb is that if you run the same experiment twice, the `input` should be identical" }, "output": { "nullable": true, "description": "The output of your application, including post-processing (an arbitrary, JSON serializable object), that allows you to determine whether the result is correct or not. For example, in an app that generates SQL queries, the `output` should be the _result_ of the SQL query generated by the model, not the query itself, because there may be multiple valid queries that answer a single question" }, "expected": { "nullable": true, "description": "The ground truth value (an arbitrary, JSON serializable object) that you'd compare to `output` to determine if your `output` value is correct or not. Braintrust currently does not compare `output` to `expected` for you, since there are so many different ways to do that correctly. Instead, these values are just used to help you navigate your experiments while digging into analyses. However, we may later use these values to re-score outputs or fine-tune your models" }, "error": { "nullable": true, "description": "The error that occurred, if any." }, "scores": { "type": "object", "nullable": true, "additionalProperties": { "type": "number", "nullable": true, "minimum": 0, "maximum": 1 }, "description": "A dictionary of numeric values (between 0 and 1) to log. The scores should give you a variety of signals that help you determine how accurate the outputs are compared to what you expect and diagnose failures. For example, a summarization app might have one score that tells you how accurate the summary is, and another that measures the word similarity between the generated and grouth truth summary. The word similarity score could help you determine whether the summarization was covering similar concepts or not. You can use these scores to help you sort, filter, and compare experiments" }, "metadata": { "type": "object", "nullable": true, "properties": { "model": { "type": "string", "nullable": true, "description": "The model used for this example" } }, "additionalProperties": { "nullable": true }, "description": "A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags to log" }, "metrics": { "type": "object", "nullable": true, "properties": { "start": { "type": "number", "nullable": true, "description": "A unix timestamp recording when the section of code which produced the experiment event started" }, "end": { "type": "number", "nullable": true, "description": "A unix timestamp recording when the section of code which produced the experiment event finished" }, "prompt_tokens": { "type": "integer", "nullable": true, "description": "The number of tokens in the prompt used to generate the experiment event (only set if this is an LLM span)" }, "completion_tokens": { "type": "integer", "nullable": true, "description": "The number of tokens in the completion generated by the model (only set if this is an LLM span)" }, "tokens": { "type": "integer", "nullable": true, "description": "The total number of tokens in the input and output of the experiment event." }, "caller_functionname": { "nullable": true, "description": "This metric is deprecated" }, "caller_filename": { "nullable": true, "description": "This metric is deprecated" }, "caller_lineno": { "nullable": true, "description": "This metric is deprecated" } }, "additionalProperties": { "type": "number" }, "description": "Metrics are numerical measurements tracking the execution of the code that produced the experiment event. Use \"start\" and \"end\" to track the time span over which the experiment event was produced" }, "context": { "type": "object", "nullable": true, "properties": { "caller_functionname": { "type": "string", "nullable": true, "description": "The function in code which created the experiment event" }, "caller_filename": { "type": "string", "nullable": true, "description": "Name of the file in code where the experiment event was created" }, "caller_lineno": { "type": "integer", "nullable": true, "description": "Line of code where the experiment event was created" } }, "additionalProperties": { "nullable": true }, "description": "Context is additional information about the code that produced the experiment event. It is essentially the textual counterpart to `metrics`. Use the `caller_*` attributes to track the location in code which produced the experiment event" }, "span_id": { "type": "string", "description": "A unique identifier used to link different experiment events together as part of a full trace. See the [tracing guide](https://www.braintrust.dev/docs/instrument) for full details on tracing" }, "span_parents": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "An array of the parent `span_ids` of this experiment event. This should be empty for the root span of a trace, and should most often contain just one parent element for subspans" }, "root_span_id": { "type": "string", "description": "A unique identifier for the trace this experiment event belongs to" }, "span_attributes": { "$ref": "#/components/schemas/SpanAttributes" }, "is_root": { "type": "boolean", "nullable": true, "description": "Whether this span is a root span" }, "origin": { "$ref": "#/components/schemas/ObjectReferenceNullish" }, "comments": { "type": "array", "nullable": true, "items": { "nullable": true }, "description": "Optional list of comments attached to this event" }, "audit_data": { "type": "array", "nullable": true, "items": { "nullable": true }, "description": "Optional list of audit entries attached to this event" }, "facets": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Facets for categorization (dictionary from facet id to value)" }, "classifications": { "type": "object", "nullable": true, "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stable classification identifier" }, "label": { "type": "string", "description": "Original label of the classification item, which is useful for search and indexing purposes" }, "confidence": { "type": "number", "nullable": true, "description": "Optional confidence score for the classification" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Optional metadata associated with the classification" }, "source": { "$ref": "#/components/schemas/SavedFunctionId" } }, "required": [ "id" ] } }, "description": "Classifications for this event (dictionary from classification name to items)" } }, "required": [ "id", "_xact_id", "created", "project_id", "experiment_id", "span_id", "root_span_id" ] }, "FetchExperimentEventsResponse": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/ExperimentEvent" }, "description": "A list of fetched events" }, "cursor": { "type": "string", "nullable": true, "description": "Pagination cursor\n\nPass this string directly as the `cursor` param to your next fetch request to get the next page of results. Not provided if the returned result set is empty." } }, "required": [ "events" ] }, "FeedbackExperimentItem": { "type": "object", "properties": { "id": { "type": "string", "description": "The id of the experiment event to log feedback for. This is the row `id` returned by `POST /v1/experiment/{experiment_id}/insert`" }, "scores": { "type": "object", "nullable": true, "additionalProperties": { "type": "number", "nullable": true, "minimum": 0, "maximum": 1 }, "description": "A dictionary of numeric values (between 0 and 1) to log. These scores will be merged into the existing scores for the experiment event" }, "expected": { "nullable": true, "description": "The ground truth value (an arbitrary, JSON serializable object) that you'd compare to `output` to determine if your `output` value is correct or not" }, "comment": { "type": "string", "nullable": true, "description": "An optional comment string to log about the experiment event" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "A dictionary with additional data about the feedback. If you have a `user_id`, you can log it here and access it in the Braintrust UI. Note, this metadata does not correspond to the main event itself, but rather the audit log attached to the event." }, "source": { "type": "string", "nullable": true, "enum": [ "app", "api", "external", null ], "description": "The source of the feedback. Must be one of \"external\" (default), \"app\", or \"api\"" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags to log" } }, "required": [ "id" ] }, "FeedbackExperimentEventRequest": { "type": "object", "properties": { "feedback": { "type": "array", "items": { "$ref": "#/components/schemas/FeedbackExperimentItem" }, "description": "A list of experiment feedback items" } }, "required": [ "feedback" ] }, "ScoreSummary": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the score" }, "score": { "type": "number", "minimum": 0, "maximum": 1, "description": "Average score across all examples" }, "diff": { "type": "number", "minimum": -1, "maximum": 1, "description": "Difference in score between the current and comparison experiment" }, "improvements": { "type": "integer", "minimum": 0, "description": "Number of improvements in the score" }, "regressions": { "type": "integer", "minimum": 0, "description": "Number of regressions in the score" } }, "required": [ "name", "score", "improvements", "regressions" ], "description": "Summary of a score's performance" }, "MetricSummary": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the metric" }, "metric": { "type": "number", "description": "Average metric across all examples" }, "unit": { "type": "string", "description": "Unit label for the metric" }, "diff": { "type": "number", "description": "Difference in metric between the current and comparison experiment" }, "improvements": { "type": "integer", "minimum": 0, "description": "Number of improvements in the metric" }, "regressions": { "type": "integer", "minimum": 0, "description": "Number of regressions in the metric" } }, "required": [ "name", "metric", "unit", "improvements", "regressions" ], "description": "Summary of a metric's performance" }, "SummarizeExperimentResponse": { "type": "object", "properties": { "project_name": { "type": "string", "description": "Name of the project that the experiment belongs to" }, "experiment_name": { "type": "string", "description": "Name of the experiment" }, "project_url": { "type": "string", "format": "uri", "description": "URL to the project's page in the Braintrust app" }, "experiment_url": { "type": "string", "format": "uri", "description": "URL to the experiment's page in the Braintrust app" }, "comparison_experiment_name": { "type": "string", "nullable": true, "description": "The experiment which scores are baselined against" }, "scores": { "type": "object", "nullable": true, "additionalProperties": { "$ref": "#/components/schemas/ScoreSummary" }, "description": "Summary of the experiment's scores" }, "metrics": { "type": "object", "nullable": true, "additionalProperties": { "$ref": "#/components/schemas/MetricSummary" }, "description": "Summary of the experiment's metrics" } }, "required": [ "project_name", "experiment_name", "project_url", "experiment_url" ], "description": "Summary of an experiment" }, "Dataset": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the dataset" }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the dataset belongs under" }, "name": { "type": "string", "description": "Name of the dataset. Within a project, dataset names are unique" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the dataset" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of dataset creation" }, "deleted_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of dataset deletion, or null if the dataset is still active" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifies the user who created the dataset" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the dataset" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "User-controlled metadata about the dataset" }, "url_slug": { "type": "string", "description": "URL slug for the dataset. used to construct dataset URLs" } }, "required": [ "id", "project_id", "name", "url_slug" ] }, "CreateDataset": { "type": "object", "properties": { "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the dataset belongs under" }, "name": { "type": "string", "minLength": 1, "description": "Name of the dataset. Within a project, dataset names are unique" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the dataset" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the dataset" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "User-controlled metadata about the dataset" } }, "required": [ "project_id", "name" ] }, "PatchDataset": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the dataset. Within a project, dataset names are unique" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the dataset" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the dataset" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "User-controlled metadata about the dataset" } } }, "InsertDatasetEvent": { "type": "object", "properties": { "input": { "nullable": true, "description": "The argument that uniquely define an input case (an arbitrary, JSON serializable object)" }, "expected": { "nullable": true, "description": "The output of your application, including post-processing (an arbitrary, JSON serializable object)" }, "metadata": { "type": "object", "nullable": true, "properties": { "model": { "type": "string", "nullable": true, "description": "The model used for this example" } }, "additionalProperties": { "nullable": true }, "description": "A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags to log" }, "id": { "type": "string", "nullable": true, "description": "A unique identifier for the dataset event. If you don't provide one, Braintrust will generate one for you" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "The timestamp the dataset event was created" }, "origin": { "$ref": "#/components/schemas/ObjectReferenceNullish" }, "facets": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Facets for categorization (dictionary from facet id to value)" }, "_object_delete": { "type": "boolean", "nullable": true, "description": "Pass `_object_delete=true` to mark the dataset event deleted. Deleted events will not show up in subsequent fetches for this dataset" }, "_is_merge": { "type": "boolean", "nullable": true, "description": "The `_is_merge` field controls how the row is merged with any existing row with the same id in the DB. By default (or when set to `false`), the existing row is completely replaced by the new row. When set to `true`, the new row is deep-merged into the existing row, if one is found. If no existing row is found, the new row is inserted as is.\n\nFor example, say there is an existing row in the DB `{\"id\": \"foo\", \"input\": {\"a\": 5, \"b\": 10}}`. If we merge a new row as `{\"_is_merge\": true, \"id\": \"foo\", \"input\": {\"b\": 11, \"c\": 20}}`, the new row will be `{\"id\": \"foo\", \"input\": {\"a\": 5, \"b\": 11, \"c\": 20}}`. If we replace the new row as `{\"id\": \"foo\", \"input\": {\"b\": 11, \"c\": 20}}`, the new row will be `{\"id\": \"foo\", \"input\": {\"b\": 11, \"c\": 20}}`" }, "_merge_paths": { "type": "array", "nullable": true, "items": { "type": "array", "items": { "type": "string" } }, "description": "The `_merge_paths` field allows controlling the depth of the merge, when `_is_merge=true`. `_merge_paths` is a list of paths, where each path is a list of field names. The deep merge will not descend below any of the specified merge paths.\n\nFor example, say there is an existing row in the DB `{\"id\": \"foo\", \"input\": {\"a\": {\"b\": 10}, \"c\": {\"d\": 20}}, \"output\": {\"a\": 20}}`. If we merge a new row as `{\"_is_merge\": true, \"_merge_paths\": [[\"input\", \"a\"], [\"output\"]], \"input\": {\"a\": {\"q\": 30}, \"c\": {\"e\": 30}, \"bar\": \"baz\"}, \"output\": {\"d\": 40}}`, the new row will be `{\"id\": \"foo\": \"input\": {\"a\": {\"q\": 30}, \"c\": {\"d\": 20, \"e\": 30}, \"bar\": \"baz\"}, \"output\": {\"d\": 40}}`. In this case, due to the merge paths, we have replaced `input.a` and `output`, but have still deep-merged `input` and `input.c`." }, "_array_delete": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "path": { "type": "array", "items": { "type": "string" } }, "delete": { "type": "array", "items": { "nullable": true } } }, "required": [ "path", "delete" ] }, "description": "The `_array_delete` field allows removing specific values from array fields. It is an array of objects with `path` and `delete` properties.\n\nFor example, to remove tags \"foo\" and \"bar\" from an existing row: `{\"_is_merge\": true, \"_array_delete\": [{\"path\": [\"tags\"], \"delete\": [\"foo\", \"bar\"]}]}`. For nested fields like `metadata.categories`, use `[{\"path\": [\"metadata\", \"categories\"], \"delete\": [\"value\"]}]`. This will remove those specific values from the array while preserving others." }, "_parent_id": { "type": "string", "nullable": true, "description": "DEPRECATED: The `_parent_id` field is deprecated and should not be used. Support for `_parent_id` will be dropped in a future version of Braintrust. Log `span_id`, `root_span_id`, and `span_parents` explicitly instead.\n\nUse the `_parent_id` field to create this row as a subspan of an existing row. Tracking hierarchical relationships are important for tracing (see the [guide](https://www.braintrust.dev/docs/instrument) for full details).\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"_parent_id\": \"abc\", \"id\": \"llm_call\", \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." }, "span_id": { "type": "string", "nullable": true, "description": "Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the [guide](https://www.braintrust.dev/docs/instrument) for full details.\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"span_id\": \"span0\", \"root_span_id\": \"root_span0\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"id\": \"llm_call\", \"span_id\": \"span1\", \"root_span_id\": \"root_span0\", \"span_parents\": [\"span0\"], \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." }, "root_span_id": { "type": "string", "nullable": true, "description": "Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the [guide](https://www.braintrust.dev/docs/instrument) for full details.\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"span_id\": \"span0\", \"root_span_id\": \"root_span0\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"id\": \"llm_call\", \"span_id\": \"span1\", \"root_span_id\": \"root_span0\", \"span_parents\": [\"span0\"], \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." }, "span_parents": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Use `span_id`, `root_span_id`, and `span_parents` instead of `_parent_id`, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the [guide](https://www.braintrust.dev/docs/instrument) for full details.\n\nFor example, say we have logged a row `{\"id\": \"abc\", \"span_id\": \"span0\", \"root_span_id\": \"root_span0\", \"input\": \"foo\", \"output\": \"bar\", \"expected\": \"boo\", \"scores\": {\"correctness\": 0.33}}`. We can create a sub-span of the parent row by logging `{\"id\": \"llm_call\", \"span_id\": \"span1\", \"root_span_id\": \"root_span0\", \"span_parents\": [\"span0\"], \"input\": {\"prompt\": \"What comes after foo?\"}, \"output\": \"bar\", \"metrics\": {\"tokens\": 1}}`. In the webapp, only the root span row `\"abc\"` will show up in the summary view. You can view the full trace hierarchy (in this case, the `\"llm_call\"` row) by clicking on the \"abc\" row.\n\nIf the row is being merged into an existing row, this field will be ignored." } }, "description": "A dataset event" }, "InsertDatasetEventRequest": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/InsertDatasetEvent" }, "description": "A list of dataset events to insert" } }, "required": [ "events" ] }, "DatasetEvent": { "type": "object", "properties": { "id": { "type": "string", "description": "A unique identifier for the dataset event. If you don't provide one, Braintrust will generate one for you" }, "_xact_id": { "type": "string", "description": "The transaction id of an event is unique to the network operation that processed the event insertion. Transaction ids are monotonically increasing over time and can be used to retrieve a versioned snapshot of the dataset (see the `version` parameter)" }, "created": { "type": "string", "format": "date-time", "description": "The timestamp the dataset event was created" }, "_pagination_key": { "type": "string", "nullable": true, "description": "A stable, time-ordered key that can be used to paginate over dataset events. This field is auto-generated by Braintrust and only exists in Brainstore." }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the dataset belongs under" }, "dataset_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the dataset" }, "input": { "nullable": true, "description": "The argument that uniquely define an input case (an arbitrary, JSON serializable object)" }, "expected": { "nullable": true, "description": "The output of your application, including post-processing (an arbitrary, JSON serializable object)" }, "metadata": { "type": "object", "nullable": true, "properties": { "model": { "type": "string", "nullable": true, "description": "The model used for this example" } }, "additionalProperties": { "nullable": true }, "description": "A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags to log" }, "span_id": { "type": "string", "description": "A unique identifier used to link different dataset events together as part of a full trace. See the [tracing guide](https://www.braintrust.dev/docs/instrument) for full details on tracing" }, "root_span_id": { "type": "string", "description": "A unique identifier for the trace this dataset event belongs to" }, "is_root": { "type": "boolean", "nullable": true, "description": "Whether this span is a root span" }, "origin": { "$ref": "#/components/schemas/ObjectReferenceNullish" }, "comments": { "type": "array", "nullable": true, "items": { "nullable": true }, "description": "Optional list of comments attached to this event" }, "audit_data": { "type": "array", "nullable": true, "items": { "nullable": true }, "description": "Optional list of audit entries attached to this event" }, "facets": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Facets for categorization (dictionary from facet id to value)" }, "classifications": { "type": "object", "nullable": true, "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stable classification identifier" }, "label": { "type": "string", "description": "Original label of the classification item, which is useful for search and indexing purposes" }, "confidence": { "type": "number", "nullable": true, "description": "Optional confidence score for the classification" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Optional metadata associated with the classification" }, "source": { "$ref": "#/components/schemas/SavedFunctionId" } }, "required": [ "id" ] } }, "description": "Classifications for this event (dictionary from classification name to items)" } }, "required": [ "id", "_xact_id", "created", "project_id", "dataset_id", "span_id", "root_span_id" ] }, "FetchDatasetEventsResponse": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/DatasetEvent" }, "description": "A list of fetched events" }, "cursor": { "type": "string", "nullable": true, "description": "Pagination cursor\n\nPass this string directly as the `cursor` param to your next fetch request to get the next page of results. Not provided if the returned result set is empty." } }, "required": [ "events" ] }, "FeedbackDatasetItem": { "type": "object", "properties": { "id": { "type": "string", "description": "The id of the dataset event to log feedback for. This is the row `id` returned by `POST /v1/dataset/{dataset_id}/insert`" }, "comment": { "type": "string", "nullable": true, "description": "An optional comment string to log about the dataset event" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "A dictionary with additional data about the feedback. If you have a `user_id`, you can log it here and access it in the Braintrust UI. Note, this metadata does not correspond to the main event itself, but rather the audit log attached to the event." }, "source": { "type": "string", "nullable": true, "enum": [ "app", "api", "external", null ], "description": "The source of the feedback. Must be one of \"external\" (default), \"app\", or \"api\"" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags to log" } }, "required": [ "id" ] }, "FeedbackDatasetEventRequest": { "type": "object", "properties": { "feedback": { "type": "array", "items": { "$ref": "#/components/schemas/FeedbackDatasetItem" }, "description": "A list of dataset feedback items" } }, "required": [ "feedback" ] }, "DataSummary": { "type": "object", "nullable": true, "properties": { "total_records": { "type": "integer", "minimum": 0, "description": "Total number of records in the dataset" } }, "required": [ "total_records" ], "description": "Summary of a dataset's data" }, "SummarizeDatasetResponse": { "type": "object", "properties": { "project_name": { "type": "string", "description": "Name of the project that the dataset belongs to" }, "dataset_name": { "type": "string", "description": "Name of the dataset" }, "project_url": { "type": "string", "format": "uri", "description": "URL to the project's page in the Braintrust app" }, "dataset_url": { "type": "string", "format": "uri", "description": "URL to the dataset's page in the Braintrust app" }, "data_summary": { "$ref": "#/components/schemas/DataSummary" } }, "required": [ "project_name", "dataset_name", "project_url", "dataset_url" ], "description": "Summary of a dataset" }, "ChatCompletionContentPartText": { "type": "object", "properties": { "text": { "type": "string", "default": "" }, "type": { "type": "string", "enum": [ "text" ] }, "cache_control": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "ephemeral" ] } }, "required": [ "type" ] } }, "required": [ "type" ] }, "ChatCompletionContentPartTextWithTitle": { "type": "object", "properties": { "text": { "type": "string", "default": "" }, "type": { "type": "string", "enum": [ "text" ] }, "cache_control": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "ephemeral" ] } }, "required": [ "type" ] } }, "required": [ "type" ], "title": "text" }, "ChatCompletionContentPartImageWithTitle": { "type": "object", "properties": { "image_url": { "type": "object", "properties": { "url": { "type": "string" }, "detail": { "anyOf": [ { "type": "string", "enum": [ "auto" ], "title": "auto" }, { "type": "string", "enum": [ "low" ], "title": "low" }, { "type": "string", "enum": [ "high" ], "title": "high" } ] } }, "required": [ "url" ] }, "type": { "type": "string", "enum": [ "image_url" ] } }, "required": [ "image_url", "type" ], "title": "image_url" }, "ChatCompletionContentPartFileFile": { "type": "object", "properties": { "file_data": { "type": "string" }, "filename": { "type": "string" }, "file_id": { "type": "string", "title": "The ID of an uploaded file to use as input." } } }, "ChatCompletionContentPartFileWithTitle": { "type": "object", "properties": { "file": { "$ref": "#/components/schemas/ChatCompletionContentPartFileFile" }, "type": { "type": "string", "enum": [ "file" ] } }, "required": [ "file", "type" ], "title": "file" }, "ChatCompletionContentPart": { "anyOf": [ { "$ref": "#/components/schemas/ChatCompletionContentPartTextWithTitle" }, { "$ref": "#/components/schemas/ChatCompletionContentPartImageWithTitle" }, { "$ref": "#/components/schemas/ChatCompletionContentPartFileWithTitle" } ], "title": "chat_completion_content_part" }, "ChatCompletionMessageToolCall": { "type": "object", "properties": { "id": { "type": "string" }, "function": { "type": "object", "properties": { "arguments": { "type": "string" }, "name": { "type": "string" } }, "required": [ "arguments", "name" ] }, "type": { "type": "string", "enum": [ "function" ] } }, "required": [ "id", "function", "type" ] }, "ChatCompletionMessageReasoning": { "type": "object", "properties": { "id": { "type": "string", "nullable": true }, "content": { "type": "string", "nullable": true } }, "description": "Note: This is not part of the OpenAI API spec, but we added it for interoperability with multiple reasoning models." }, "ChatCompletionMessageParam": { "anyOf": [ { "type": "object", "properties": { "content": { "anyOf": [ { "type": "string", "default": "", "title": "text" }, { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionContentPartText" }, "title": "array" } ] }, "role": { "type": "string", "enum": [ "system" ] }, "name": { "type": "string" } }, "required": [ "role" ], "title": "system" }, { "type": "object", "properties": { "content": { "anyOf": [ { "type": "string", "default": "", "title": "text" }, { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionContentPart" }, "title": "array" } ] }, "role": { "type": "string", "enum": [ "user" ] }, "name": { "type": "string" } }, "required": [ "role" ], "title": "user" }, { "type": "object", "properties": { "role": { "type": "string", "enum": [ "assistant" ] }, "content": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionContentPartText" } }, { "type": "null" } ] }, "function_call": { "type": "object", "nullable": true, "properties": { "arguments": { "type": "string" }, "name": { "type": "string" } }, "required": [ "arguments", "name" ] }, "name": { "type": "string", "nullable": true }, "tool_calls": { "type": "array", "nullable": true, "items": { "$ref": "#/components/schemas/ChatCompletionMessageToolCall" } }, "reasoning": { "type": "array", "nullable": true, "items": { "$ref": "#/components/schemas/ChatCompletionMessageReasoning" } }, "reasoning_signature": { "type": "string", "nullable": true } }, "required": [ "role" ], "title": "assistant" }, { "type": "object", "properties": { "content": { "anyOf": [ { "type": "string", "default": "", "title": "text" }, { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionContentPartText" }, "title": "array" } ] }, "role": { "type": "string", "enum": [ "tool" ] }, "tool_call_id": { "type": "string", "default": "" } }, "required": [ "role" ], "title": "tool" }, { "type": "object", "properties": { "content": { "type": "string", "nullable": true }, "name": { "type": "string" }, "role": { "type": "string", "enum": [ "function" ] } }, "required": [ "content", "name", "role" ], "title": "function" }, { "type": "object", "properties": { "content": { "anyOf": [ { "type": "string", "default": "", "title": "text" }, { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionContentPartText" }, "title": "array" } ] }, "role": { "type": "string", "enum": [ "developer" ] }, "name": { "type": "string" } }, "required": [ "role" ], "title": "developer" }, { "type": "object", "properties": { "role": { "type": "string", "enum": [ "model" ] }, "content": { "type": "string", "nullable": true } }, "required": [ "role" ], "title": "fallback" } ] }, "PromptBlockDataNullish": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "chat" ] }, "messages": { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionMessageParam" } }, "tools": { "type": "string" } }, "required": [ "type", "messages" ], "title": "chat" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "completion" ] }, "content": { "type": "string" } }, "required": [ "type", "content" ], "title": "completion" }, { "type": "null" } ] }, "ResponseFormatJsonSchema": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "schema": { "anyOf": [ { "type": "object", "additionalProperties": { "nullable": true }, "title": "object", "x-stainless-skip": [ "go" ] }, { "type": "string", "title": "string" } ] }, "strict": { "type": "boolean", "nullable": true } }, "required": [ "name" ] }, "ResponseFormatNullish": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "json_object" ] } }, "required": [ "type" ], "title": "json_object" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "json_schema" ] }, "json_schema": { "$ref": "#/components/schemas/ResponseFormatJsonSchema" } }, "required": [ "type", "json_schema" ], "title": "json_schema" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text" ] } }, "required": [ "type" ], "title": "text" }, { "type": "null" } ] }, "ModelParams": { "anyOf": [ { "type": "object", "properties": { "use_cache": { "type": "boolean" }, "reasoning_enabled": { "type": "boolean" }, "reasoning_budget": { "type": "number" }, "temperature": { "type": "number" }, "top_p": { "type": "number" }, "max_tokens": { "type": "number" }, "max_completion_tokens": { "type": "number", "description": "The successor to max_tokens" }, "frequency_penalty": { "type": "number" }, "presence_penalty": { "type": "number" }, "response_format": { "$ref": "#/components/schemas/ResponseFormatNullish" }, "tool_choice": { "anyOf": [ { "type": "string", "enum": [ "auto" ], "title": "auto" }, { "type": "string", "enum": [ "none" ], "title": "none" }, { "type": "string", "enum": [ "required" ], "title": "required" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ] } }, "required": [ "type", "function" ], "title": "function" } ] }, "function_call": { "anyOf": [ { "type": "string", "enum": [ "auto" ], "title": "auto" }, { "type": "string", "enum": [ "none" ], "title": "none" }, { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "title": "function" } ] }, "n": { "type": "number" }, "stop": { "type": "array", "items": { "type": "string" } }, "reasoning_effort": { "type": "string", "enum": [ "none", "minimal", "low", "medium", "high" ] }, "verbosity": { "type": "string", "enum": [ "low", "medium", "high" ] } }, "additionalProperties": { "nullable": true }, "title": "OpenAIModelParams", "x-stainless-skip": [ "go" ] }, { "type": "object", "properties": { "use_cache": { "type": "boolean" }, "reasoning_enabled": { "type": "boolean" }, "reasoning_budget": { "type": "number" }, "max_tokens": { "type": "number" }, "temperature": { "type": "number" }, "top_p": { "type": "number" }, "top_k": { "type": "number" }, "stop_sequences": { "type": "array", "items": { "type": "string" } }, "max_tokens_to_sample": { "type": "number", "description": "This is a legacy parameter that should not be used." } }, "required": [ "max_tokens", "temperature" ], "additionalProperties": { "nullable": true }, "title": "AnthropicModelParams", "x-stainless-skip": [ "go" ] }, { "type": "object", "properties": { "use_cache": { "type": "boolean" }, "reasoning_enabled": { "type": "boolean" }, "reasoning_budget": { "type": "number" }, "temperature": { "type": "number" }, "maxOutputTokens": { "type": "number" }, "topP": { "type": "number" }, "topK": { "type": "number" } }, "additionalProperties": { "nullable": true }, "title": "GoogleModelParams", "x-stainless-skip": [ "go" ] }, { "type": "object", "properties": { "use_cache": { "type": "boolean" }, "reasoning_enabled": { "type": "boolean" }, "reasoning_budget": { "type": "number" }, "temperature": { "type": "number" }, "topK": { "type": "number" } }, "additionalProperties": { "nullable": true }, "title": "WindowAIModelParams", "x-stainless-skip": [ "go" ] }, { "type": "object", "properties": { "use_cache": { "type": "boolean" }, "reasoning_enabled": { "type": "boolean" }, "reasoning_budget": { "type": "number" } }, "additionalProperties": { "nullable": true }, "title": "JsCompletionParams", "x-stainless-skip": [ "go" ] } ] }, "PromptOptionsNullish": { "type": "object", "nullable": true, "properties": { "model": { "type": "string" }, "params": { "$ref": "#/components/schemas/ModelParams" }, "position": { "type": "string" } } }, "PromptParserNullish": { "type": "object", "nullable": true, "properties": { "type": { "type": "string", "enum": [ "llm_classifier" ] }, "use_cot": { "type": "boolean" }, "choice_scores": { "type": "object", "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }, "description": "Map of choices to scores (0-1). Used by scorers." }, "choice": { "type": "array", "items": { "type": "string" }, "description": "List of valid choices without score mapping. Used by classifiers that deposit output to tags." }, "allow_no_match": { "type": "boolean", "description": "If true, adds a 'No match' option. When selected, no tag is deposited." } }, "required": [ "type", "use_cot" ] }, "PromptDataNullish": { "type": "object", "nullable": true, "properties": { "prompt": { "$ref": "#/components/schemas/PromptBlockDataNullish" }, "options": { "$ref": "#/components/schemas/PromptOptionsNullish" }, "parser": { "$ref": "#/components/schemas/PromptParserNullish" }, "tool_functions": { "type": "array", "nullable": true, "items": { "allOf": [ { "$ref": "#/components/schemas/SavedFunctionId" }, { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "function" ] }, "id": { "type": "string" }, "version": { "type": "string", "description": "The version of the function" } }, "required": [ "type", "id" ], "title": "function" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "global" ] }, "name": { "type": "string" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" } }, "required": [ "type", "name" ], "title": "global" } ] } ] } }, "template_format": { "type": "string", "nullable": true, "enum": [ "mustache", "nunjucks", "none", null ] }, "mcp": { "type": "object", "nullable": true, "additionalProperties": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "id" ] }, "id": { "type": "string", "format": "uuid" }, "is_disabled": { "type": "boolean" }, "enabled_tools": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "If omitted, all tools are enabled" } }, "required": [ "type", "id" ], "title": "MCP server id. This is used for project-level MCP server definitions." }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "url" ] }, "url": { "type": "string" }, "is_disabled": { "type": "boolean" }, "enabled_tools": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "If omitted, all tools are enabled" } }, "required": [ "type", "url" ], "title": "MCP server url. This is used for inline definitions of MCP servers." } ] } }, "origin": { "type": "object", "nullable": true, "properties": { "prompt_id": { "type": "string" }, "project_id": { "type": "string" }, "prompt_version": { "type": "string" } } } }, "description": "The prompt, model, and its parameters" }, "FunctionTypeEnumNullish": { "type": "string", "nullable": true, "enum": [ "llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox", null ] }, "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "_xact_id": { "type": "string", "description": "The transaction id of an event is unique to the network operation that processed the event insertion. Transaction ids are monotonically increasing over time and can be used to retrieve a versioned snapshot of the prompt (see the `version` parameter)" }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the prompt belongs under" }, "log_id": { "type": "string", "enum": [ "p" ], "description": "A literal 'p' which identifies the object as a project prompt" }, "org_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the organization" }, "name": { "type": "string", "description": "Name of the prompt" }, "slug": { "type": "string", "description": "Unique identifier for the prompt" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the prompt" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of prompt creation" }, "prompt_data": { "$ref": "#/components/schemas/PromptDataNullish" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the prompt" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "User-controlled metadata about the prompt" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnumNullish" } }, "required": [ "id", "_xact_id", "project_id", "log_id", "org_id", "name", "slug" ] }, "CreatePrompt": { "type": "object", "properties": { "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the prompt belongs under" }, "name": { "type": "string", "minLength": 1, "description": "Name of the prompt" }, "slug": { "type": "string", "minLength": 1, "description": "Unique identifier for the prompt" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the prompt" }, "prompt_data": { "$ref": "#/components/schemas/PromptDataNullish" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the prompt" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnumNullish" } }, "required": [ "project_id", "name", "slug" ] }, "PatchPrompt": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the prompt" }, "slug": { "type": "string", "nullable": true, "description": "Unique identifier for the prompt" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the prompt" }, "prompt_data": { "$ref": "#/components/schemas/PromptDataNullish" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the prompt" } } }, "Permission": { "type": "string", "enum": [ "create", "read", "update", "delete", "create_acls", "read_acls", "update_acls", "delete_acls" ], "description": "Each permission permits a certain type of operation on an object in the system\n\nPermissions can be assigned to to objects on an individual basis, or grouped into roles" }, "Role": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the role" }, "org_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Unique id for the organization that the role belongs under\n\nA null org_id indicates a system role, which may be assigned to anybody and inherited by any other role, but cannot be edited.\n\nIt is forbidden to change the org after creating a role" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifies the user who created the role" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of role creation" }, "name": { "type": "string", "description": "Name of the role" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the role" }, "deleted_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of role deletion, or null if the role is still active" }, "member_permissions": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "permission": { "$ref": "#/components/schemas/Permission" }, "restrict_object_type": { "$ref": "#/components/schemas/AclObjectType", "nullable": true } }, "required": [ "permission" ] }, "description": "(permission, restrict_object_type) tuples which belong to this role" }, "member_roles": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Ids of the roles this role inherits from\n\nAn inheriting role has all the permissions contained in its member roles, as well as all of their inherited permissions" } }, "required": [ "id", "name" ], "description": "A role is a collection of permissions which can be granted as part of an ACL\n\nRoles can consist of individual permissions, as well as a set of roles they inherit from" }, "CreateRole": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "Name of the role" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the role" }, "member_permissions": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "permission": { "$ref": "#/components/schemas/Permission" }, "restrict_object_type": { "$ref": "#/components/schemas/AclObjectType", "nullable": true } }, "required": [ "permission" ] }, "description": "(permission, restrict_object_type) tuples which belong to this role" }, "member_roles": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Ids of the roles this role inherits from\n\nAn inheriting role has all the permissions contained in its member roles, as well as all of their inherited permissions" }, "org_name": { "type": "string", "nullable": true, "description": "For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, you may specify the name of the organization the role belongs in." } }, "required": [ "name" ] }, "PatchRole": { "type": "object", "properties": { "description": { "type": "string", "nullable": true, "description": "Textual description of the role" }, "name": { "type": "string", "nullable": true, "minLength": 1, "description": "Name of the role" }, "add_member_permissions": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "permission": { "$ref": "#/components/schemas/Permission" }, "restrict_object_type": { "$ref": "#/components/schemas/AclObjectType", "nullable": true } }, "required": [ "permission" ] }, "description": "A list of permissions to add to the role" }, "remove_member_permissions": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "permission": { "$ref": "#/components/schemas/Permission" }, "restrict_object_type": { "$ref": "#/components/schemas/AclObjectType", "nullable": true } }, "required": [ "permission" ] }, "description": "A list of permissions to remove from the role" }, "add_member_roles": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "A list of role IDs to add to the role's inheriting-from set" }, "remove_member_roles": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "A list of role IDs to remove from the role's inheriting-from set" } } }, "Group": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the group" }, "org_id": { "type": "string", "format": "uuid", "description": "Unique id for the organization that the group belongs under\n\nIt is forbidden to change the org after creating a group" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifies the user who created the group" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of group creation" }, "name": { "type": "string", "description": "Name of the group" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the group" }, "deleted_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of group deletion, or null if the group is still active" }, "member_users": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Ids of users which belong to this group" }, "member_groups": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Ids of the groups this group inherits from\n\nAn inheriting group has all the users contained in its member groups, as well as all of their inherited users" } }, "required": [ "id", "org_id", "name" ], "description": "A group is a collection of users which can be assigned an ACL\n\nGroups can consist of individual users, as well as a set of groups they inherit from" }, "CreateGroup": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "Name of the group" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the group" }, "member_users": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Ids of users which belong to this group" }, "member_groups": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "Ids of the groups this group inherits from\n\nAn inheriting group has all the users contained in its member groups, as well as all of their inherited users" }, "org_name": { "type": "string", "nullable": true, "description": "For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, you may specify the name of the organization the group belongs in." } }, "required": [ "name" ] }, "PatchGroup": { "type": "object", "properties": { "description": { "type": "string", "nullable": true, "description": "Textual description of the group" }, "name": { "type": "string", "nullable": true, "minLength": 1, "description": "Name of the group" }, "add_member_users": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "A list of user IDs to add to the group" }, "remove_member_users": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "A list of user IDs to remove from the group" }, "add_member_groups": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "A list of group IDs to add to the group's inheriting-from set" }, "remove_member_groups": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid" }, "description": "A list of group IDs to remove from the group's inheriting-from set" } } }, "Acl": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the acl" }, "object_type": { "$ref": "#/components/schemas/AclObjectType" }, "object_id": { "type": "string", "format": "uuid", "description": "The id of the object the ACL applies to" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will be provided" }, "group_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will be provided" }, "permission": { "$ref": "#/components/schemas/Permission", "nullable": true, "description": "Permission the ACL grants. Exactly one of `permission` and `role_id` will be provided" }, "restrict_object_type": { "$ref": "#/components/schemas/AclObjectType", "nullable": true, "description": "When setting a permission directly, optionally restricts the permission grant to just the specified object type. Cannot be set alongside a `role_id`." }, "role_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be provided" }, "_object_org_id": { "type": "string", "format": "uuid", "description": "The organization the ACL's referred object belongs to" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of acl creation" } }, "required": [ "id", "object_type", "object_id", "_object_org_id" ], "description": "An ACL grants a certain permission or role to a certain user or group on an object.\n\nACLs are inherited across the object hierarchy. So for example, if a user has read permissions on a project, they will also have read permissions on any experiment, dataset, etc. created within that project.\n\nTo restrict a grant to a particular sub-object, you may specify `restrict_object_type` in the ACL, as part of a direct permission grant or as part of a role." }, "AclItem": { "type": "object", "properties": { "object_type": { "$ref": "#/components/schemas/AclObjectType" }, "object_id": { "type": "string", "format": "uuid", "description": "The id of the object the ACL applies to" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will be provided" }, "group_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will be provided" }, "permission": { "$ref": "#/components/schemas/Permission", "nullable": true, "description": "Permission the ACL grants. Exactly one of `permission` and `role_id` will be provided" }, "restrict_object_type": { "$ref": "#/components/schemas/AclObjectType", "nullable": true, "description": "When setting a permission directly, optionally restricts the permission grant to just the specified object type. Cannot be set alongside a `role_id`." }, "role_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be provided" } }, "required": [ "object_type", "object_id" ], "description": "An ACL grants a certain permission or role to a certain user or group on an object.\n\nACLs are inherited across the object hierarchy. So for example, if a user has read permissions on a project, they will also have read permissions on any experiment, dataset, etc. created within that project.\n\nTo restrict a grant to a particular sub-object, you may specify `restrict_object_type` in the ACL, as part of a direct permission grant or as part of a role." }, "AclBatchUpdateResponse": { "type": "object", "properties": { "added_acls": { "type": "array", "items": { "$ref": "#/components/schemas/Acl" } }, "removed_acls": { "type": "array", "items": { "$ref": "#/components/schemas/Acl" } } }, "required": [ "added_acls", "removed_acls" ] }, "AclBatchUpdateRequest": { "type": "object", "properties": { "add_acls": { "type": "array", "nullable": true, "items": { "$ref": "#/components/schemas/AclItem" } }, "remove_acls": { "type": "array", "nullable": true, "items": { "$ref": "#/components/schemas/AclItem" } } } }, "User": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the user" }, "given_name": { "type": "string", "nullable": true, "description": "Given name of the user" }, "family_name": { "type": "string", "nullable": true, "description": "Family name of the user" }, "email": { "type": "string", "nullable": true, "description": "The user's email" }, "avatar_url": { "type": "string", "nullable": true, "description": "URL of the user's Avatar image" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of user creation" } }, "required": [ "id" ] }, "SpanScope": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "span" ] } }, "required": [ "type" ], "description": "Process individual spans" }, "TraceScope": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "trace" ] }, "idle_seconds": { "type": "number", "description": "Consider trace complete after this many seconds of inactivity (default: 30)" } }, "required": [ "type" ], "description": "Process entire traces (all spans sharing the same root_span_id)" }, "GroupScope": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "group" ] }, "group_by": { "type": "string", "description": "Field path to group by, e.g. metadata.session_id" }, "idle_seconds": { "type": "number", "description": "Optional: trigger after this many seconds of inactivity" } }, "required": [ "type", "group_by" ], "description": "Process spans/traces grouped by a field (e.g., session_id)" }, "RetentionObjectType": { "type": "string", "enum": [ "project_logs", "experiment", "dataset" ], "description": "The object type that the retention policy applies to" }, "TopicAutomationFacetModel": { "type": "string", "nullable": true, "enum": [ "brain-facet-latest", "brain-facet-1", "brain-facet-2", null ], "description": "Optional facet model override for topic automation" }, "TopicMapFunctionAutomation": { "type": "object", "properties": { "function": { "allOf": [ { "$ref": "#/components/schemas/SavedFunctionId" }, { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "function" ] }, "id": { "type": "string" }, "version": { "type": "string", "description": "The version of the function" } }, "required": [ "type", "id" ], "title": "function" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "global" ] }, "name": { "type": "string" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" } }, "required": [ "type", "name" ], "title": "global" } ], "description": "Topic map function" } ] }, "btql_filter": { "type": "string", "nullable": true, "description": "Per-topic-map BTQL filter. For trace scope, a topic map runs when max(filter) over the trace is truthy. For span scope, it runs when the current span matches." } }, "required": [ "function" ] }, "TopicAutomationDataScope": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "project_logs" ] } }, "required": [ "type" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "project_experiments" ] } }, "required": [ "type" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "experiment" ] }, "experiment_id": { "type": "string" } }, "required": [ "type", "experiment_id" ] }, { "type": "null" } ], "description": "Optional data scope for topic automation." }, "TopicAutomationConfig": { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "topic" ], "description": "The type of automation." }, "sampling_rate": { "type": "number", "minimum": 0, "maximum": 1, "description": "The sampling rate for topic automation" }, "facet_model": { "$ref": "#/components/schemas/TopicAutomationFacetModel" }, "facet_functions": { "type": "array", "items": { "allOf": [ { "$ref": "#/components/schemas/SavedFunctionId" }, { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "function" ] }, "id": { "type": "string" }, "version": { "type": "string", "description": "The version of the function" } }, "required": [ "type", "id" ], "title": "function" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "global" ] }, "name": { "type": "string" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" } }, "required": [ "type", "name" ], "title": "global" } ] } ] }, "description": "Facet functions used by the topic automation" }, "topic_map_functions": { "type": "array", "items": { "$ref": "#/components/schemas/TopicMapFunctionAutomation" }, "description": "Topic map functions with optional per-topic-map filters" }, "scope": { "anyOf": [ { "$ref": "#/components/schemas/SpanScope" }, { "$ref": "#/components/schemas/TraceScope" }, { "$ref": "#/components/schemas/GroupScope" }, { "type": "null" } ], "description": "Execution scope for topic automation. Defaults to span-level execution." }, "data_scope": { "$ref": "#/components/schemas/TopicAutomationDataScope" }, "btql_filter": { "type": "string", "nullable": true, "description": "Optional BTQL filter applied before topic automation." }, "rerun_seconds": { "type": "number", "nullable": true, "minimum": 600, "description": "How often to recompute topic maps" }, "relabel_overlap_seconds": { "type": "number", "nullable": true, "minimum": 60, "description": "How much recent history to relabel after a new topic map version becomes active" }, "backfill_time_range": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "from": { "type": "string" }, "to": { "type": "string" } }, "required": [ "from", "to" ] }, { "type": "null" } ], "description": "Topic window used for classification coverage and initial backfill." } }, "required": [ "event_type", "sampling_rate", "facet_functions", "topic_map_functions" ] }, "ProjectAutomation": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project automation" }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the project automation belongs under" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifies the user who created the project automation" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of project automation creation" }, "name": { "type": "string", "description": "Name of the project automation" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the project automation" }, "config": { "oneOf": [ { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "logs" ], "description": "The type of automation." }, "btql_filter": { "type": "string", "description": "BTQL filter to identify rows for the automation rule" }, "interval_seconds": { "type": "number", "minimum": 1, "maximum": 2592000, "description": "Perform the triggered action at most once in this interval of seconds" }, "action": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "webhook" ], "description": "The type of action to take" }, "url": { "type": "string", "description": "The webhook URL to send the request to" } }, "required": [ "type", "url" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "slack" ], "description": "The type of action to take" }, "workspace_id": { "type": "string", "description": "The Slack workspace ID to post to" }, "channel": { "type": "string", "description": "The Slack channel ID to post to" }, "message_template": { "type": "string", "description": "Custom message template for the alert" } }, "required": [ "type", "workspace_id", "channel" ] } ], "description": "The action to take when the automation rule is triggered" } }, "required": [ "event_type", "btql_filter", "interval_seconds", "action" ] }, { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "btql_export" ], "description": "The type of automation." }, "export_definition": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "log_traces" ] } }, "required": [ "type" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "log_spans" ] } }, "required": [ "type" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "btql_query" ] }, "btql_query": { "type": "string", "description": "The BTQL query to export" } }, "required": [ "type", "btql_query" ] } ], "description": "The definition of what to export" }, "scope": { "anyOf": [ { "$ref": "#/components/schemas/SpanScope" }, { "$ref": "#/components/schemas/TraceScope" }, { "$ref": "#/components/schemas/GroupScope" }, { "type": "null" } ], "description": "Execution scope for export automation. Defaults to span-level execution." }, "export_path": { "type": "string", "description": "The path to export the results to. It should include the storage protocol and prefix, e.g. s3://bucket-name/path/to/export" }, "format": { "type": "string", "enum": [ "jsonl", "parquet" ], "description": "The format to export the results in" }, "interval_seconds": { "type": "number", "minimum": 1, "maximum": 2592000, "description": "Perform the triggered action at most once in this interval of seconds" }, "credentials": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "aws_iam" ] }, "role_arn": { "type": "string", "description": "The ARN of the IAM role to use" }, "external_id": { "type": "string", "description": "The automation-specific external id component (auto-generated by default)" } }, "required": [ "type", "role_arn", "external_id" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "gcp_service_account" ] }, "service_account_email": { "type": "string", "description": "The GCP service account email to impersonate" } }, "required": [ "type", "service_account_email" ] } ] }, "batch_size": { "type": "number", "nullable": true, "description": "The number of rows to export in each batch" } }, "required": [ "event_type", "export_definition", "export_path", "format", "interval_seconds", "credentials" ] }, { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "retention" ], "description": "The type of automation." }, "object_type": { "$ref": "#/components/schemas/RetentionObjectType" }, "retention_days": { "type": "number", "minimum": 0, "description": "The number of days to retain the object" } }, "required": [ "event_type", "object_type", "retention_days" ] }, { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "environment_update" ], "description": "The type of automation." }, "environment_filter": { "type": "array", "items": { "type": "string" }, "description": "Optional list of environment slugs to filter by" }, "action": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "webhook" ], "description": "The type of action to take" }, "url": { "type": "string", "description": "The webhook URL to send the request to" } }, "required": [ "type", "url" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "slack" ], "description": "The type of action to take" }, "workspace_id": { "type": "string", "description": "The Slack workspace ID to post to" }, "channel": { "type": "string", "description": "The Slack channel ID to post to" }, "message_template": { "type": "string", "description": "Custom message template for the alert" } }, "required": [ "type", "workspace_id", "channel" ] } ], "description": "The action to take when the automation rule is triggered" } }, "required": [ "event_type", "action" ] }, { "$ref": "#/components/schemas/TopicAutomationConfig" } ], "description": "The configuration for the automation rule" } }, "required": [ "id", "project_id", "name", "config" ] }, "CreateProjectAutomation": { "type": "object", "properties": { "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the project automation belongs under" }, "name": { "type": "string", "description": "Name of the project automation" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the project automation" }, "config": { "oneOf": [ { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "logs" ], "description": "The type of automation." }, "btql_filter": { "type": "string", "description": "BTQL filter to identify rows for the automation rule" }, "interval_seconds": { "type": "number", "minimum": 1, "maximum": 2592000, "description": "Perform the triggered action at most once in this interval of seconds" }, "action": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "webhook" ], "description": "The type of action to take" }, "url": { "type": "string", "description": "The webhook URL to send the request to" } }, "required": [ "type", "url" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "slack" ], "description": "The type of action to take" }, "workspace_id": { "type": "string", "description": "The Slack workspace ID to post to" }, "channel": { "type": "string", "description": "The Slack channel ID to post to" }, "message_template": { "type": "string", "description": "Custom message template for the alert" } }, "required": [ "type", "workspace_id", "channel" ] } ], "description": "The action to take when the automation rule is triggered" } }, "required": [ "event_type", "btql_filter", "interval_seconds", "action" ] }, { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "btql_export" ], "description": "The type of automation." }, "export_definition": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "log_traces" ] } }, "required": [ "type" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "log_spans" ] } }, "required": [ "type" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "btql_query" ] }, "btql_query": { "type": "string", "description": "The BTQL query to export" } }, "required": [ "type", "btql_query" ] } ], "description": "The definition of what to export" }, "scope": { "anyOf": [ { "$ref": "#/components/schemas/SpanScope" }, { "$ref": "#/components/schemas/TraceScope" }, { "$ref": "#/components/schemas/GroupScope" }, { "type": "null" } ], "description": "Execution scope for export automation. Defaults to span-level execution." }, "export_path": { "type": "string", "description": "The path to export the results to. It should include the storage protocol and prefix, e.g. s3://bucket-name/path/to/export" }, "format": { "type": "string", "enum": [ "jsonl", "parquet" ], "description": "The format to export the results in" }, "interval_seconds": { "type": "number", "minimum": 1, "maximum": 2592000, "description": "Perform the triggered action at most once in this interval of seconds" }, "credentials": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "aws_iam" ] }, "role_arn": { "type": "string", "description": "The ARN of the IAM role to use" }, "external_id": { "type": "string", "description": "The automation-specific external id component (auto-generated by default)" } }, "required": [ "type", "role_arn", "external_id" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "gcp_service_account" ] }, "service_account_email": { "type": "string", "description": "The GCP service account email to impersonate" } }, "required": [ "type", "service_account_email" ] } ] }, "batch_size": { "type": "number", "nullable": true, "description": "The number of rows to export in each batch" } }, "required": [ "event_type", "export_definition", "export_path", "format", "interval_seconds", "credentials" ] }, { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "retention" ], "description": "The type of automation." }, "object_type": { "$ref": "#/components/schemas/RetentionObjectType" }, "retention_days": { "type": "number", "minimum": 0, "description": "The number of days to retain the object" } }, "required": [ "event_type", "object_type", "retention_days" ] }, { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "environment_update" ], "description": "The type of automation." }, "environment_filter": { "type": "array", "items": { "type": "string" }, "description": "Optional list of environment slugs to filter by" }, "action": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "webhook" ], "description": "The type of action to take" }, "url": { "type": "string", "description": "The webhook URL to send the request to" } }, "required": [ "type", "url" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "slack" ], "description": "The type of action to take" }, "workspace_id": { "type": "string", "description": "The Slack workspace ID to post to" }, "channel": { "type": "string", "description": "The Slack channel ID to post to" }, "message_template": { "type": "string", "description": "Custom message template for the alert" } }, "required": [ "type", "workspace_id", "channel" ] } ], "description": "The action to take when the automation rule is triggered" } }, "required": [ "event_type", "action" ] }, { "$ref": "#/components/schemas/TopicAutomationConfig" } ], "description": "The configuration for the automation rule" } }, "required": [ "project_id", "name", "config" ] }, "PatchProjectAutomation": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the project automation" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the project automation" }, "config": { "oneOf": [ { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "logs" ], "description": "The type of automation." }, "btql_filter": { "type": "string", "description": "BTQL filter to identify rows for the automation rule" }, "interval_seconds": { "type": "number", "minimum": 1, "maximum": 2592000, "description": "Perform the triggered action at most once in this interval of seconds" }, "action": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "webhook" ], "description": "The type of action to take" }, "url": { "type": "string", "description": "The webhook URL to send the request to" } }, "required": [ "type", "url" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "slack" ], "description": "The type of action to take" }, "workspace_id": { "type": "string", "description": "The Slack workspace ID to post to" }, "channel": { "type": "string", "description": "The Slack channel ID to post to" }, "message_template": { "type": "string", "description": "Custom message template for the alert" } }, "required": [ "type", "workspace_id", "channel" ] } ], "description": "The action to take when the automation rule is triggered" } }, "required": [ "event_type", "btql_filter", "interval_seconds", "action" ] }, { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "btql_export" ], "description": "The type of automation." }, "export_definition": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "log_traces" ] } }, "required": [ "type" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "log_spans" ] } }, "required": [ "type" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "btql_query" ] }, "btql_query": { "type": "string", "description": "The BTQL query to export" } }, "required": [ "type", "btql_query" ] } ], "description": "The definition of what to export" }, "scope": { "anyOf": [ { "$ref": "#/components/schemas/SpanScope" }, { "$ref": "#/components/schemas/TraceScope" }, { "$ref": "#/components/schemas/GroupScope" }, { "type": "null" } ], "description": "Execution scope for export automation. Defaults to span-level execution." }, "export_path": { "type": "string", "description": "The path to export the results to. It should include the storage protocol and prefix, e.g. s3://bucket-name/path/to/export" }, "format": { "type": "string", "enum": [ "jsonl", "parquet" ], "description": "The format to export the results in" }, "interval_seconds": { "type": "number", "minimum": 1, "maximum": 2592000, "description": "Perform the triggered action at most once in this interval of seconds" }, "credentials": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "aws_iam" ] }, "role_arn": { "type": "string", "description": "The ARN of the IAM role to use" }, "external_id": { "type": "string", "description": "The automation-specific external id component (auto-generated by default)" } }, "required": [ "type", "role_arn", "external_id" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "gcp_service_account" ] }, "service_account_email": { "type": "string", "description": "The GCP service account email to impersonate" } }, "required": [ "type", "service_account_email" ] } ] }, "batch_size": { "type": "number", "nullable": true, "description": "The number of rows to export in each batch" } }, "required": [ "event_type", "export_definition", "export_path", "format", "interval_seconds", "credentials" ] }, { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "retention" ], "description": "The type of automation." }, "object_type": { "$ref": "#/components/schemas/RetentionObjectType" }, "retention_days": { "type": "number", "minimum": 0, "description": "The number of days to retain the object" } }, "required": [ "event_type", "object_type", "retention_days" ] }, { "type": "object", "properties": { "event_type": { "type": "string", "enum": [ "environment_update" ], "description": "The type of automation." }, "environment_filter": { "type": "array", "items": { "type": "string" }, "description": "Optional list of environment slugs to filter by" }, "action": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "webhook" ], "description": "The type of action to take" }, "url": { "type": "string", "description": "The webhook URL to send the request to" } }, "required": [ "type", "url" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "slack" ], "description": "The type of action to take" }, "workspace_id": { "type": "string", "description": "The Slack workspace ID to post to" }, "channel": { "type": "string", "description": "The Slack channel ID to post to" }, "message_template": { "type": "string", "description": "Custom message template for the alert" } }, "required": [ "type", "workspace_id", "channel" ] } ], "description": "The action to take when the automation rule is triggered" } }, "required": [ "event_type", "action" ] }, { "$ref": "#/components/schemas/TopicAutomationConfig" }, { "nullable": true } ], "description": "The configuration for the automation rule" } } }, "ProjectScoreCategory": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the category" }, "value": { "type": "number", "description": "Numerical value of the category. Must be between 0 and 1, inclusive" } }, "required": [ "name", "value" ], "description": "For categorical-type project scores, defines a single category" }, "ProjectScoreCategories": { "anyOf": [ { "type": "array", "items": { "$ref": "#/components/schemas/ProjectScoreCategory" }, "description": "For categorical-type project scores, the list of all categories", "title": "categorical" }, { "type": "object", "additionalProperties": { "type": "number" }, "description": "For weighted-type project scores, the weights of each score", "title": "weighted", "x-stainless-skip": [ "go" ] }, { "type": "array", "items": { "type": "string" }, "description": "For minimum-type project scores, the list of included scores", "title": "minimum" }, { "type": "null" } ] }, "OnlineScoreConfig": { "type": "object", "nullable": true, "properties": { "sampling_rate": { "type": "number", "minimum": 0, "maximum": 1, "description": "The sampling rate for online scoring" }, "scorers": { "type": "array", "items": { "allOf": [ { "$ref": "#/components/schemas/SavedFunctionId" }, { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "function" ] }, "id": { "type": "string" }, "version": { "type": "string", "description": "The version of the function" } }, "required": [ "type", "id" ], "title": "function" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "global" ] }, "name": { "type": "string" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" } }, "required": [ "type", "name" ], "title": "global" } ] } ] }, "description": "The list of functions to run for online scoring. Can include scorers, facets, or other function types." }, "btql_filter": { "type": "string", "nullable": true, "description": "Filter logs using BTQL" }, "apply_to_root_span": { "type": "boolean", "nullable": true, "description": "Whether to trigger online scoring on the root span of each trace. Only applies when scope is 'span' or unset." }, "apply_to_span_names": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Trigger online scoring on any spans with a name in this list. Only applies when scope is 'span' or unset." }, "skip_logging": { "type": "boolean", "nullable": true, "description": "Whether to skip adding scorer spans when computing scores" }, "scope": { "anyOf": [ { "$ref": "#/components/schemas/SpanScope" }, { "$ref": "#/components/schemas/TraceScope" }, { "$ref": "#/components/schemas/GroupScope" }, { "type": "null" } ], "description": "The scope at which to run the functions. Defaults to span-level execution. Trace/group scope requires all functions to be facets." } }, "required": [ "sampling_rate", "scorers" ] }, "ProjectScoreConfig": { "type": "object", "nullable": true, "properties": { "multi_select": { "type": "boolean", "nullable": true }, "destination": { "type": "string", "nullable": true }, "online": { "$ref": "#/components/schemas/OnlineScoreConfig" } } }, "ProjectScore": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project score" }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the project score belongs under" }, "user_id": { "type": "string", "format": "uuid" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of project score creation" }, "name": { "type": "string", "description": "Name of the project score" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the project score" }, "score_type": { "$ref": "#/components/schemas/ProjectScoreType" }, "categories": { "$ref": "#/components/schemas/ProjectScoreCategories" }, "config": { "$ref": "#/components/schemas/ProjectScoreConfig" }, "position": { "type": "string", "nullable": true, "description": "An optional LexoRank-based string that sets the sort position for the score in the UI" } }, "required": [ "id", "project_id", "user_id", "name", "score_type" ], "description": "A project score is a user-configured score, which can be manually-labeled through the UI" }, "CreateProjectScore": { "type": "object", "properties": { "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the project score belongs under" }, "name": { "type": "string", "description": "Name of the project score" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the project score" }, "score_type": { "$ref": "#/components/schemas/ProjectScoreType" }, "categories": { "$ref": "#/components/schemas/ProjectScoreCategories" }, "config": { "$ref": "#/components/schemas/ProjectScoreConfig" } }, "required": [ "project_id", "name", "score_type" ], "description": "A project score is a user-configured score, which can be manually-labeled through the UI" }, "PatchProjectScore": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the project score" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the project score" }, "score_type": { "$ref": "#/components/schemas/ProjectScoreType", "nullable": true }, "categories": { "$ref": "#/components/schemas/ProjectScoreCategories" }, "config": { "$ref": "#/components/schemas/ProjectScoreConfig" } }, "description": "A project score is a user-configured score, which can be manually-labeled through the UI" }, "ProjectTag": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project tag" }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the project tag belongs under" }, "user_id": { "type": "string", "format": "uuid" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of project tag creation" }, "name": { "type": "string", "description": "Name of the project tag" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the project tag" }, "color": { "type": "string", "nullable": true, "description": "Color of the tag for the UI" }, "position": { "type": "string", "nullable": true, "description": "An optional LexoRank-based string that sets the sort position for the tag in the UI" } }, "required": [ "id", "project_id", "user_id", "name" ], "description": "A project tag is a user-configured tag for tracking and filtering your experiments, logs, and other data" }, "CreateProjectTag": { "type": "object", "properties": { "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the project tag belongs under" }, "name": { "type": "string", "description": "Name of the project tag" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the project tag" }, "color": { "type": "string", "nullable": true, "description": "Color of the tag for the UI" } }, "required": [ "project_id", "name" ] }, "PatchProjectTag": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the project tag" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the project tag" }, "color": { "type": "string", "nullable": true, "description": "Color of the tag for the UI" } } }, "SpanIFrame": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the span iframe" }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the span iframe belongs under" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifies the user who created the span iframe" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of span iframe creation" }, "deleted_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of span iframe deletion, or null if the span iframe is still active" }, "name": { "type": "string", "description": "Name of the span iframe" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the span iframe" }, "url": { "type": "string", "description": "URL to embed the project viewer in an iframe" }, "post_message": { "type": "boolean", "nullable": true, "description": "Whether to post messages to the iframe containing the span's data. This is useful when you want to render more data than fits in the URL." } }, "required": [ "id", "project_id", "name", "url" ] }, "CreateSpanIFrame": { "type": "object", "properties": { "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the span iframe belongs under" }, "name": { "type": "string", "description": "Name of the span iframe" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the span iframe" }, "url": { "type": "string", "description": "URL to embed the project viewer in an iframe" }, "post_message": { "type": "boolean", "nullable": true, "description": "Whether to post messages to the iframe containing the span's data. This is useful when you want to render more data than fits in the URL." } }, "required": [ "project_id", "name", "url" ] }, "PatchSpanIFrame": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the span iframe" }, "url": { "type": "string", "nullable": true, "description": "URL to embed the project viewer in an iframe" }, "post_message": { "type": "boolean", "nullable": true, "description": "Whether to post messages to the iframe containing the span's data. This is useful when you want to render more data than fits in the URL." }, "description": { "type": "string", "nullable": true, "description": "Textual description of the span iframe" } } }, "CodeBundle": { "type": "object", "properties": { "runtime_context": { "type": "object", "properties": { "runtime": { "type": "string", "enum": [ "node", "python", "browser", "quickjs" ] }, "version": { "type": "string" } }, "required": [ "runtime", "version" ] }, "location": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "experiment" ] }, "eval_name": { "type": "string" }, "position": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "task" ] } }, "required": [ "type" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "scorer" ] }, "index": { "type": "integer", "minimum": 0 } }, "required": [ "type", "index" ], "title": "scorer" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "classifier" ] }, "index": { "type": "integer", "minimum": 0 } }, "required": [ "type", "index" ], "title": "classifier" } ] } }, "required": [ "type", "eval_name", "position" ], "title": "experiment" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "function" ] }, "index": { "type": "integer", "minimum": 0 } }, "required": [ "type", "index" ], "title": "function" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "sandbox" ] }, "sandbox_spec": { "oneOf": [ { "type": "object", "properties": { "provider": { "type": "string", "enum": [ "modal" ] }, "snapshot_ref": { "type": "string", "description": "sandbox snapshot ref" } }, "required": [ "provider", "snapshot_ref" ] }, { "type": "object", "properties": { "provider": { "type": "string", "enum": [ "lambda" ] } }, "required": [ "provider" ] } ] }, "entrypoints": { "type": "array", "items": { "type": "string" }, "description": "Which entrypoints to execute in the sandbox" }, "eval_name": { "type": "string" }, "parameters": { "type": "object", "additionalProperties": { "nullable": true }, "description": "Parameter values for sandbox eval execution" }, "evaluator_definition": { "nullable": true, "description": "Definition of current evaluator with parameters" } }, "required": [ "type", "sandbox_spec", "eval_name" ] } ] }, "bundle_id": { "type": "string", "nullable": true }, "preview": { "type": "string", "nullable": true, "description": "A preview of the code" } }, "required": [ "runtime_context", "location" ] }, "FunctionIdRef": { "type": "object", "properties": {}, "additionalProperties": { "nullable": true }, "description": "Options for identifying a function" }, "PromptBlockData": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "chat" ] }, "messages": { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionMessageParam" } }, "tools": { "type": "string" } }, "required": [ "type", "messages" ], "title": "chat" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "completion" ] }, "content": { "type": "string" } }, "required": [ "type", "content" ], "title": "completion" } ] }, "GraphNode": { "anyOf": [ { "type": "object", "properties": { "description": { "type": "string", "nullable": true, "description": "The description of the node" }, "position": { "type": "object", "nullable": true, "properties": { "x": { "type": "number", "description": "The x position of the node" }, "y": { "type": "number", "description": "The y position of the node" } }, "required": [ "x", "y" ], "description": "The position of the node" }, "type": { "type": "string", "enum": [ "function" ] }, "function": { "$ref": "#/components/schemas/FunctionIdRef" } }, "required": [ "type", "function" ] }, { "type": "object", "properties": { "description": { "type": "string", "nullable": true, "description": "The description of the node" }, "position": { "type": "object", "nullable": true, "properties": { "x": { "type": "number", "description": "The x position of the node" }, "y": { "type": "number", "description": "The y position of the node" } }, "required": [ "x", "y" ], "description": "The position of the node" }, "type": { "type": "string", "enum": [ "input" ], "description": "The input to the graph" } }, "required": [ "type" ] }, { "type": "object", "properties": { "description": { "type": "string", "nullable": true, "description": "The description of the node" }, "position": { "type": "object", "nullable": true, "properties": { "x": { "type": "number", "description": "The x position of the node" }, "y": { "type": "number", "description": "The y position of the node" } }, "required": [ "x", "y" ], "description": "The position of the node" }, "type": { "type": "string", "enum": [ "output" ], "description": "The output of the graph" } }, "required": [ "type" ] }, { "type": "object", "properties": { "description": { "type": "string", "nullable": true, "description": "The description of the node" }, "position": { "type": "object", "nullable": true, "properties": { "x": { "type": "number", "description": "The x position of the node" }, "y": { "type": "number", "description": "The y position of the node" } }, "required": [ "x", "y" ], "description": "The position of the node" }, "type": { "type": "string", "enum": [ "literal" ] }, "value": { "nullable": true, "description": "A literal value to be returned" } }, "required": [ "type" ] }, { "type": "object", "properties": { "description": { "type": "string", "nullable": true, "description": "The description of the node" }, "position": { "type": "object", "nullable": true, "properties": { "x": { "type": "number", "description": "The x position of the node" }, "y": { "type": "number", "description": "The y position of the node" } }, "required": [ "x", "y" ], "description": "The position of the node" }, "type": { "type": "string", "enum": [ "btql" ] }, "expr": { "type": "string", "description": "A BTQL expression to be evaluated" } }, "required": [ "type", "expr" ] }, { "type": "object", "properties": { "description": { "type": "string", "nullable": true, "description": "The description of the node" }, "position": { "type": "object", "nullable": true, "properties": { "x": { "type": "number", "description": "The x position of the node" }, "y": { "type": "number", "description": "The y position of the node" } }, "required": [ "x", "y" ], "description": "The position of the node" }, "type": { "type": "string", "enum": [ "gate" ] }, "condition": { "type": "string", "nullable": true, "description": "A BTQL expression to be evaluated" } }, "required": [ "type" ] }, { "type": "object", "properties": { "description": { "type": "string", "nullable": true, "description": "The description of the node" }, "position": { "type": "object", "nullable": true, "properties": { "x": { "type": "number", "description": "The x position of the node" }, "y": { "type": "number", "description": "The y position of the node" } }, "required": [ "x", "y" ], "description": "The position of the node" }, "type": { "type": "string", "enum": [ "aggregator" ] } }, "required": [ "type" ] }, { "type": "object", "properties": { "description": { "type": "string", "nullable": true, "description": "The description of the node" }, "position": { "type": "object", "nullable": true, "properties": { "x": { "type": "number", "description": "The x position of the node" }, "y": { "type": "number", "description": "The y position of the node" } }, "required": [ "x", "y" ], "description": "The position of the node" }, "type": { "type": "string", "enum": [ "prompt_template" ] }, "prompt": { "$ref": "#/components/schemas/PromptBlockData" } }, "required": [ "type", "prompt" ] } ] }, "GraphEdge": { "type": "object", "properties": { "source": { "type": "object", "properties": { "node": { "type": "string", "maxLength": 1024, "description": "The id of the node in the graph" }, "variable": { "type": "string" } }, "required": [ "node", "variable" ] }, "target": { "type": "object", "properties": { "node": { "type": "string", "maxLength": 1024, "description": "The id of the node in the graph" }, "variable": { "type": "string" } }, "required": [ "node", "variable" ] }, "purpose": { "type": "string", "enum": [ "control", "data", "messages" ], "description": "The purpose of the edge" } }, "required": [ "source", "target", "purpose" ] }, "GraphData": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "graph" ] }, "nodes": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/GraphNode" } }, "edges": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/GraphEdge" } } }, "required": [ "type", "nodes", "edges" ], "description": "This feature is preliminary and unsupported.", "title": "graph" }, "FacetData": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "facet" ] }, "preprocessor": { "allOf": [ { "$ref": "#/components/schemas/NullableSavedFunctionId" }, { "description": "The preprocessor function to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor." } ] }, "prompt": { "type": "string", "description": "The prompt to use for LLM extraction. The preprocessed text will be provided as context." }, "model": { "type": "string", "description": "The model to use for facet extraction" }, "embedding_model": { "type": "string", "description": "The embedding model to use for vectorizing facet results." }, "no_match_pattern": { "type": "string", "description": "Regex pattern to identify outputs that do not match the facet. If the output matches, the facet will be saved as 'no_match'" } }, "required": [ "type", "prompt" ], "title": "facet" }, "TopicMapGenerationSettings": { "type": "object", "properties": { "algorithm": { "type": "string", "enum": [ "hdbscan", "kmeans" ] }, "dimension_reduction": { "type": "string", "enum": [ "umap", "pca", "none" ] }, "sample_size": { "type": "integer", "minimum": 0, "exclusiveMinimum": true }, "n_clusters": { "type": "integer", "minimum": 0, "exclusiveMinimum": true }, "min_cluster_size": { "type": "integer", "minimum": 0, "exclusiveMinimum": true }, "min_samples": { "type": "integer", "minimum": 0, "exclusiveMinimum": true }, "hierarchy_threshold": { "type": "integer", "minimum": 0, "exclusiveMinimum": true }, "naming_model": { "type": "string" } }, "required": [ "algorithm", "dimension_reduction" ], "description": "Clustering and naming settings used to generate this topic map" }, "TopicMapData": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "topic_map" ] }, "source_facet": { "type": "string", "description": "The facet field name to use as input for classification" }, "embedding_model": { "type": "string", "description": "The embedding model to use for embedding facet values" }, "bundle_key": { "type": "string", "description": "Key of the topic map bundle in code_bundles bucket" }, "report_key": { "type": "string", "description": "Key of the clustering report in code_bundles bucket" }, "topic_names": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Mapping from topic_id to topic name" }, "generation_settings": { "$ref": "#/components/schemas/TopicMapGenerationSettings" }, "disable_reconciliation": { "type": "boolean", "description": "Whether new topic generation should ignore the previously saved report during reconciliation. Defaults to false when omitted." }, "distance_threshold": { "type": "number", "description": "Maximum distance to nearest centroid. If exceeded, returns no_match." } }, "required": [ "type", "source_facet", "embedding_model" ] }, "BatchedFacetData": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "batched_facet" ] }, "preprocessor": { "allOf": [ { "$ref": "#/components/schemas/NullableSavedFunctionId" }, { "description": "The preprocessor function to use for facet extraction. If not provided, the project default preprocessor will be used, falling back to the global 'thread' preprocessor." } ] }, "facets": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the facet" }, "prompt": { "type": "string", "description": "The prompt to use for LLM extraction. The preprocessed text will be provided as context." }, "model": { "type": "string", "description": "The model to use for facet extraction" }, "embedding_model": { "type": "string", "description": "The embedding model to use for vectorizing facet results." }, "no_match_pattern": { "type": "string", "description": "Regex pattern to identify outputs that do not match the facet. If the output matches, the facet will be saved as 'no_match'" } }, "required": [ "name", "prompt" ] } }, "topic_maps": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "function_name": { "type": "string", "description": "The name of the topic map function" }, "topic_map_id": { "type": "string", "description": "The id of the topic map function" }, "topic_map_data": { "$ref": "#/components/schemas/TopicMapData" } }, "required": [ "function_name", "topic_map_data" ] } }, "description": "Topic maps that depend on facets in this batch, keyed by source facet name. Each source facet can have multiple topic maps." } }, "required": [ "type", "facets" ], "title": "batched_facet" }, "FunctionData": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "prompt" ] } }, "required": [ "type" ], "title": "prompt" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "code" ] }, "data": { "anyOf": [ { "allOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "bundle" ] } }, "required": [ "type" ] }, { "$ref": "#/components/schemas/CodeBundle" } ], "title": "bundle" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "inline" ] }, "runtime_context": { "type": "object", "properties": { "runtime": { "type": "string", "enum": [ "node", "python", "browser", "quickjs" ] }, "version": { "type": "string" } }, "required": [ "runtime", "version" ] }, "code": { "type": "string" }, "code_hash": { "type": "string", "description": "SHA256 hash of the code, computed at save time" } }, "required": [ "type", "runtime_context", "code" ], "title": "inline" } ] } }, "required": [ "type", "data" ], "title": "code" }, { "$ref": "#/components/schemas/GraphData" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "remote_eval" ] }, "endpoint": { "type": "string" }, "eval_name": { "type": "string" }, "parameters": { "type": "object", "additionalProperties": { "nullable": true } }, "parameters_version": { "type": "string", "nullable": true, "description": "The version (transaction ID) of the parameters being used" } }, "required": [ "type", "endpoint", "eval_name", "parameters" ], "description": "A remote eval to run", "title": "remote_eval" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "global" ] }, "name": { "type": "string" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" }, "config": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Configuration options to pass to the global function (e.g., for preprocessor customization)" } }, "required": [ "type", "name" ], "title": "global" }, { "$ref": "#/components/schemas/FacetData" }, { "$ref": "#/components/schemas/BatchedFacetData" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "parameters" ] }, "data": { "type": "object", "additionalProperties": { "nullable": true }, "description": "The parameters data" }, "__schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "object" ] }, "properties": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "nullable": true } } }, "required": { "type": "array", "items": { "type": "string" } }, "additionalProperties": { "type": "boolean" } }, "required": [ "type", "properties" ], "description": "JSON Schema format for parameters" } }, "required": [ "type", "data", "__schema" ], "title": "parameters" }, { "allOf": [ { "$ref": "#/components/schemas/TopicMapData" }, { "title": "topic_map" } ] } ] }, "Function": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "_xact_id": { "type": "string", "description": "The transaction id of an event is unique to the network operation that processed the event insertion. Transaction ids are monotonically increasing over time and can be used to retrieve a versioned snapshot of the prompt (see the `version` parameter)" }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the prompt belongs under" }, "log_id": { "type": "string", "enum": [ "p" ], "description": "A literal 'p' which identifies the object as a project prompt" }, "org_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the organization" }, "name": { "type": "string", "description": "Name of the prompt" }, "slug": { "type": "string", "description": "Unique identifier for the prompt" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the prompt" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of prompt creation" }, "prompt_data": { "$ref": "#/components/schemas/PromptDataNullish" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the prompt" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "User-controlled metadata about the prompt" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnumNullish" }, "function_data": { "$ref": "#/components/schemas/FunctionData" }, "origin": { "type": "object", "nullable": true, "properties": { "object_type": { "$ref": "#/components/schemas/AclObjectType" }, "object_id": { "type": "string", "format": "uuid", "description": "Id of the object the function is originating from" }, "internal": { "type": "boolean", "nullable": true, "description": "The function exists for internal purposes and should not be displayed in the list of functions." } }, "required": [ "object_type", "object_id" ] }, "function_schema": { "type": "object", "nullable": true, "properties": { "parameters": { "nullable": true }, "returns": { "nullable": true } }, "description": "JSON schema for the function's parameters and return type" } }, "required": [ "id", "_xact_id", "project_id", "log_id", "org_id", "name", "slug", "function_data" ] }, "CreateFunction": { "type": "object", "properties": { "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the prompt belongs under" }, "name": { "type": "string", "minLength": 1, "description": "Name of the prompt" }, "slug": { "type": "string", "minLength": 1, "description": "Unique identifier for the prompt" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the prompt" }, "prompt_data": { "$ref": "#/components/schemas/PromptDataNullish" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the prompt" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnumNullish" }, "function_data": { "$ref": "#/components/schemas/FunctionData" }, "origin": { "type": "object", "nullable": true, "properties": { "object_type": { "$ref": "#/components/schemas/AclObjectType" }, "object_id": { "type": "string", "format": "uuid", "description": "Id of the object the function is originating from" }, "internal": { "type": "boolean", "nullable": true, "description": "The function exists for internal purposes and should not be displayed in the list of functions." } }, "required": [ "object_type", "object_id" ] }, "function_schema": { "type": "object", "nullable": true, "properties": { "parameters": { "nullable": true }, "returns": { "nullable": true } }, "description": "JSON schema for the function's parameters and return type" } }, "required": [ "project_id", "name", "slug", "function_data" ] }, "FunctionDataNullish": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "prompt" ] } }, "required": [ "type" ], "title": "prompt" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "code" ] }, "data": { "anyOf": [ { "allOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "bundle" ] } }, "required": [ "type" ] }, { "$ref": "#/components/schemas/CodeBundle" } ], "title": "bundle" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "inline" ] }, "runtime_context": { "type": "object", "properties": { "runtime": { "type": "string", "enum": [ "node", "python", "browser", "quickjs" ] }, "version": { "type": "string" } }, "required": [ "runtime", "version" ] }, "code": { "type": "string" }, "code_hash": { "type": "string", "description": "SHA256 hash of the code, computed at save time" } }, "required": [ "type", "runtime_context", "code" ], "title": "inline" } ] } }, "required": [ "type", "data" ], "title": "code" }, { "$ref": "#/components/schemas/GraphData" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "remote_eval" ] }, "endpoint": { "type": "string" }, "eval_name": { "type": "string" }, "parameters": { "type": "object", "additionalProperties": { "nullable": true } }, "parameters_version": { "type": "string", "nullable": true, "description": "The version (transaction ID) of the parameters being used" } }, "required": [ "type", "endpoint", "eval_name", "parameters" ], "description": "A remote eval to run", "title": "remote_eval" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "global" ] }, "name": { "type": "string" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" }, "config": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Configuration options to pass to the global function (e.g., for preprocessor customization)" } }, "required": [ "type", "name" ], "title": "global" }, { "$ref": "#/components/schemas/FacetData" }, { "$ref": "#/components/schemas/BatchedFacetData" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "parameters" ] }, "data": { "type": "object", "additionalProperties": { "nullable": true }, "description": "The parameters data" }, "__schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "object" ] }, "properties": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "nullable": true } } }, "required": { "type": "array", "items": { "type": "string" } }, "additionalProperties": { "type": "boolean" } }, "required": [ "type", "properties" ], "description": "JSON Schema format for parameters" } }, "required": [ "type", "data", "__schema" ], "title": "parameters" }, { "allOf": [ { "$ref": "#/components/schemas/TopicMapData" }, { "title": "topic_map" } ] }, { "type": "null" } ] }, "PatchFunction": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the prompt" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the prompt" }, "prompt_data": { "$ref": "#/components/schemas/PromptDataNullish" }, "function_data": { "$ref": "#/components/schemas/FunctionDataNullish" }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "A list of tags for the prompt" } } }, "InvokeParent": { "anyOf": [ { "type": "object", "properties": { "object_type": { "type": "string", "enum": [ "project_logs", "experiment", "playground_logs" ] }, "object_id": { "type": "string", "description": "The id of the container object you are logging to" }, "row_ids": { "type": "object", "nullable": true, "properties": { "id": { "type": "string", "description": "The id of the row" }, "span_id": { "type": "string", "description": "The span_id of the row" }, "root_span_id": { "type": "string", "description": "The root_span_id of the row" } }, "required": [ "id", "span_id", "root_span_id" ], "description": "Identifiers for the row to to log a subspan under" }, "propagated_event": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Include these properties in every span created under this parent" } }, "required": [ "object_type", "object_id" ], "description": "Span parent properties", "title": "span_parent_struct" }, { "type": "string", "description": "The parent's span identifier, created by calling `.export()` on a span" } ], "description": "Options for tracing the function call" }, "StreamingMode": { "type": "string", "nullable": true, "enum": [ "auto", "parallel", "json", "text", null ], "description": "The mode format of the returned value (defaults to 'auto')" }, "InvokeApi": { "type": "object", "properties": { "input": { "nullable": true, "description": "Argument to the function, which can be any JSON serializable value" }, "expected": { "nullable": true, "description": "The expected output of the function" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Any relevant metadata. This will be logged and available as the `metadata` argument." }, "tags": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Any relevant tags to log on the span." }, "messages": { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionMessageParam" }, "description": "If the function is an LLM, additional messages to pass along to it" }, "parent": { "$ref": "#/components/schemas/InvokeParent" }, "stream": { "type": "boolean", "nullable": true, "description": "Whether to stream the response. If true, results will be returned in the Braintrust SSE format." }, "mode": { "$ref": "#/components/schemas/StreamingMode" }, "strict": { "type": "boolean", "nullable": true, "description": "If true, throw an error if one of the variables in the prompt is not present in the input" }, "mcp_auth": { "type": "object", "additionalProperties": { "type": "object", "properties": { "oauth_token": { "type": "string", "description": "The OAuth token to use" } } }, "description": "Map of MCP server URL to auth credentials" }, "overrides": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Partial function definition to merge with the function being invoked. Fields are validated against the function type's schema at runtime. For facets: { preprocessor?, prompt?, model? }. For prompts: { model?, ... }." }, "version": { "type": "string", "description": "The version of the function" } }, "description": "The request to invoke a function" }, "ViewDataSearch": { "type": "object", "nullable": true, "properties": { "filter": { "type": "array", "nullable": true, "items": { "nullable": true } }, "tag": { "type": "array", "nullable": true, "items": { "nullable": true } }, "match": { "type": "array", "nullable": true, "items": { "nullable": true } }, "sort": { "type": "array", "nullable": true, "items": { "nullable": true } } } }, "ViewData": { "type": "object", "nullable": true, "properties": { "search": { "$ref": "#/components/schemas/ViewDataSearch" }, "custom_charts": { "nullable": true } }, "description": "The view definition" }, "ViewOptions": { "anyOf": [ { "type": "object", "properties": { "viewType": { "type": "string", "enum": [ "monitor" ] }, "options": { "type": "object", "properties": { "spanType": { "type": "string", "nullable": true, "enum": [ "range", "frame", null ] }, "rangeValue": { "type": "string", "nullable": true }, "frameStart": { "type": "string", "nullable": true }, "frameEnd": { "type": "string", "nullable": true }, "tzUTC": { "type": "boolean", "nullable": true }, "chartVisibility": { "type": "object", "nullable": true, "additionalProperties": { "type": "boolean" } }, "projectId": { "type": "string", "nullable": true }, "type": { "type": "string", "nullable": true, "enum": [ "project", "experiment", null ] }, "groupBy": { "type": "string", "nullable": true } } }, "freezeColumns": { "type": "boolean", "nullable": true } }, "required": [ "viewType", "options" ], "title": "MonitorViewOptions" }, { "type": "object", "properties": { "columnVisibility": { "type": "object", "nullable": true, "additionalProperties": { "type": "boolean" } }, "columnOrder": { "type": "array", "nullable": true, "items": { "type": "string" } }, "columnSizing": { "type": "object", "nullable": true, "additionalProperties": { "type": "number" } }, "grouping": { "type": "string", "nullable": true }, "rowHeight": { "type": "string", "nullable": true }, "tallGroupRows": { "type": "boolean", "nullable": true }, "layout": { "type": "string", "nullable": true }, "topicMapReportKey": { "type": "string", "nullable": true }, "chartHeight": { "type": "number", "nullable": true }, "excludedMeasures": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "none", "score", "metric", "metadata" ] }, "value": { "type": "string" } }, "required": [ "type", "value" ] } }, "yMetric": { "type": "object", "nullable": true, "properties": { "type": { "type": "string", "enum": [ "none", "score", "metric", "metadata" ] }, "value": { "type": "string" } }, "required": [ "type", "value" ] }, "xAxis": { "type": "object", "nullable": true, "properties": { "type": { "type": "string", "enum": [ "none", "score", "metric", "metadata" ] }, "value": { "type": "string" } }, "required": [ "type", "value" ] }, "symbolGrouping": { "type": "object", "nullable": true, "properties": { "type": { "type": "string", "enum": [ "none", "score", "metric", "metadata" ] }, "value": { "type": "string" } }, "required": [ "type", "value" ] }, "xAxisAggregation": { "type": "string", "nullable": true, "description": "One of 'avg', 'sum', 'min', 'max', 'median', 'all'" }, "chartAnnotations": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "id": { "type": "string" }, "text": { "type": "string" } }, "required": [ "id", "text" ] } }, "timeRangeFilter": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "from": { "type": "string" }, "to": { "type": "string" } }, "required": [ "from", "to" ] }, { "type": "null" } ] }, "queryShape": { "type": "string", "nullable": true, "enum": [ "traces", "spans", "topics", null ] }, "cluster": { "type": "string", "nullable": true }, "freezeColumns": { "type": "boolean", "nullable": true } }, "title": "TableViewOptions" }, { "type": "null" } ], "description": "Options for the view in the app" }, "View": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the view" }, "object_type": { "$ref": "#/components/schemas/AclObjectType" }, "object_id": { "type": "string", "format": "uuid", "description": "The id of the object the view applies to" }, "view_type": { "type": "string", "enum": [ "projects", "experiments", "experiment", "playgrounds", "playground", "datasets", "dataset", "prompts", "parameters", "tools", "scorers", "classifiers", "logs", "monitor", "for_review_project_log", "for_review_experiments", "for_review_datasets", null ], "description": "Type of object that the view corresponds to." }, "name": { "type": "string", "description": "Name of the view" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of view creation" }, "view_data": { "$ref": "#/components/schemas/ViewData" }, "options": { "$ref": "#/components/schemas/ViewOptions" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifies the user who created the view" }, "deleted_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of role deletion, or null if the role is still active" } }, "required": [ "id", "object_type", "object_id", "view_type", "name" ] }, "CreateView": { "type": "object", "properties": { "object_type": { "$ref": "#/components/schemas/AclObjectType" }, "object_id": { "type": "string", "format": "uuid", "description": "The id of the object the view applies to" }, "view_type": { "type": "string", "enum": [ "projects", "experiments", "experiment", "playgrounds", "playground", "datasets", "dataset", "prompts", "parameters", "tools", "scorers", "classifiers", "logs", "monitor", "for_review_project_log", "for_review_experiments", "for_review_datasets", null ], "description": "Type of object that the view corresponds to." }, "name": { "type": "string", "description": "Name of the view" }, "view_data": { "$ref": "#/components/schemas/ViewData" }, "options": { "$ref": "#/components/schemas/ViewOptions" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifies the user who created the view" }, "deleted_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of role deletion, or null if the role is still active" } }, "required": [ "object_type", "object_id", "view_type", "name" ] }, "PatchView": { "type": "object", "properties": { "object_type": { "$ref": "#/components/schemas/AclObjectType" }, "object_id": { "type": "string", "format": "uuid", "description": "The id of the object the view applies to" }, "view_type": { "type": "string", "nullable": true, "enum": [ "projects", "experiments", "experiment", "playgrounds", "playground", "datasets", "dataset", "prompts", "parameters", "tools", "scorers", "classifiers", "logs", "monitor", "for_review_project_log", "for_review_experiments", "for_review_datasets", null ], "description": "Type of object that the view corresponds to." }, "name": { "type": "string", "nullable": true, "description": "Name of the view" }, "view_data": { "$ref": "#/components/schemas/ViewData" }, "options": { "$ref": "#/components/schemas/ViewOptions" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifies the user who created the view" } }, "required": [ "object_type", "object_id" ] }, "DeleteView": { "type": "object", "properties": { "object_type": { "$ref": "#/components/schemas/AclObjectType" }, "object_id": { "type": "string", "format": "uuid", "description": "The id of the object the view applies to" } }, "required": [ "object_type", "object_id" ] }, "ImageRenderingMode": { "type": "string", "nullable": true, "enum": [ "auto", "click_to_load", "blocked", null ], "description": "Controls how images are rendered in the UI: 'auto' loads images automatically, 'click_to_load' shows a placeholder until clicked, 'blocked' prevents image loading entirely" }, "Organization": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the organization" }, "name": { "type": "string", "description": "Name of the organization" }, "api_url": { "type": "string", "nullable": true }, "is_universal_api": { "type": "boolean", "nullable": true }, "is_dataplane_private": { "type": "boolean", "nullable": true }, "proxy_url": { "type": "string", "nullable": true }, "realtime_url": { "type": "string", "nullable": true }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of organization creation" }, "image_rendering_mode": { "$ref": "#/components/schemas/ImageRenderingMode" } }, "required": [ "id", "name" ] }, "PatchOrganization": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the organization" }, "api_url": { "type": "string", "nullable": true }, "is_universal_api": { "type": "boolean", "nullable": true }, "is_dataplane_private": { "type": "boolean", "nullable": true }, "proxy_url": { "type": "string", "nullable": true }, "realtime_url": { "type": "string", "nullable": true }, "image_rendering_mode": { "$ref": "#/components/schemas/ImageRenderingMode" } } }, "PatchOrganizationMembersOutput": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "success" ] }, "org_id": { "type": "string", "description": "The id of the org that was modified." }, "send_email_error": { "type": "string", "nullable": true, "description": "If invite emails failed to send for some reason, the patch operation will still complete, but we will return an error message here" }, "added_users": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "email": { "type": "string", "nullable": true }, "api_key": { "type": "string", "nullable": true }, "token_name": { "type": "string", "nullable": true } }, "required": [ "id" ] }, "description": "If service accounts with tokens were created, this will contain the added users with their API keys" } }, "required": [ "status", "org_id" ] }, "PatchOrganizationMembers": { "type": "object", "properties": { "invite_users": { "type": "object", "nullable": true, "properties": { "ids": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid", "description": "Unique identifier for the user" }, "description": "Ids of existing users to invite" }, "emails": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Emails of users to invite" }, "service_accounts": { "type": "array", "nullable": true, "items": { "type": "object", "properties": { "name": { "type": "string" }, "token_name": { "type": "string", "nullable": true, "description": "Omit this field and create the token in the Braintrust UI ([**Settings > Service tokens**](https://www.braintrust.dev/app/~/configuration/org/service-tokens)). If you include this field, the API call will return a 403." } }, "required": [ "name" ] }, "description": "Service accounts to create. Users with organization-owner permissions can create service accounts via the API, but the service tokens required to authenticate those accounts must be created in the Braintrust UI." }, "send_invite_emails": { "type": "boolean", "nullable": true, "description": "If true, send invite emails to the users who wore actually added" }, "group_ids": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid", "description": "Unique identifier for the group" }, "description": "Optional list of group ids to add newly-invited users to." }, "group_names": { "type": "array", "nullable": true, "items": { "type": "string", "description": "Name of the group" }, "description": "Optional list of group names to add newly-invited users to." }, "group_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Singular form of group_ids" }, "group_name": { "type": "string", "nullable": true, "description": "Singular form of group_names" } }, "description": "Users to invite to the organization" }, "remove_users": { "type": "object", "nullable": true, "properties": { "ids": { "type": "array", "nullable": true, "items": { "type": "string", "format": "uuid", "description": "Unique identifier for the user" }, "description": "Ids of users to remove" }, "emails": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "Emails of users to remove" } }, "description": "Users to remove from the organization" }, "org_name": { "type": "string", "nullable": true, "description": "For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, or in case you want to explicitly assert the organization you are modifying, you may specify the name of the organization." }, "org_id": { "type": "string", "nullable": true, "description": "For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, or in case you want to explicitly assert the organization you are modifying, you may specify the id of the organization." } } }, "ApiKey": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the api key" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of api key creation" }, "name": { "type": "string", "description": "Name of the api key" }, "preview_name": { "type": "string" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Unique identifier for the user" }, "user_email": { "type": "string", "nullable": true, "description": "The user's email" }, "user_given_name": { "type": "string", "nullable": true, "description": "Given name of the user" }, "user_family_name": { "type": "string", "nullable": true, "description": "Family name of the user" }, "org_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Unique identifier for the organization" } }, "required": [ "id", "name", "preview_name" ] }, "ServiceToken": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the service token" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of service token creation" }, "name": { "type": "string", "description": "Name of the service token" }, "preview_name": { "type": "string" }, "service_account_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Unique identifier for the service token" }, "service_account_email": { "type": "string", "nullable": true, "description": "The service account email (not routable)" }, "service_account_name": { "type": "string", "nullable": true, "description": "The service account name" }, "org_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Unique identifier for the organization" } }, "required": [ "id", "name", "preview_name" ] }, "DeleteServiceToken": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the service token." } }, "required": [ "id" ] }, "AISecret": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the AI secret" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of AI secret creation" }, "updated_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of last AI secret update" }, "secret_updated_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of last update to the encrypted secret value itself" }, "org_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the organization" }, "name": { "type": "string", "description": "Name of the AI secret" }, "type": { "type": "string", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "secret_updated_by_user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "User id of the last update to the encrypted secret value" }, "preview_secret": { "type": "string", "nullable": true } }, "required": [ "id", "org_id", "name" ] }, "CreateAISecret": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the AI secret" }, "type": { "type": "string", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "secret": { "type": "string", "nullable": true, "description": "Secret value. If omitted in a PUT request, the existing secret value will be left intact, not replaced with null." }, "org_name": { "type": "string", "nullable": true, "description": "For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, you may specify the name of the organization the AI Secret belongs in." } }, "required": [ "name" ] }, "DeleteAISecret": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the AI secret" }, "org_name": { "type": "string", "nullable": true, "description": "For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, you may specify the name of the organization the AI Secret belongs in." } }, "required": [ "name" ] }, "PatchAISecret": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the AI secret" }, "type": { "type": "string", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "secret": { "type": "string", "nullable": true } } }, "EnvVar": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the environment variable" }, "object_type": { "type": "string", "enum": [ "organization", "project", "function" ], "description": "The type of the object the environment variable is scoped for" }, "object_id": { "type": "string", "format": "uuid", "description": "The id of the object the environment variable is scoped for" }, "name": { "type": "string", "description": "The name of the environment variable" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of environment variable creation" }, "secret_updated_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of last update to the encrypted secret value itself" }, "secret_updated_by_user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "User id of the last update to the encrypted secret value" }, "used": { "type": "string", "nullable": true, "format": "date-time", "description": "Date the environment variable was last used" }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Optional metadata associated with the environment variable when managed via the function secrets API" }, "preview_secret": { "type": "string", "nullable": true, "description": "Redacted preview of the stored secret value" }, "secret_type": { "type": "string", "nullable": true, "description": "Optional classification for the secret (for example, the AI provider name)" }, "secret_category": { "type": "string", "enum": [ "env_var", "ai_provider", "sandbox_provider" ], "default": "env_var", "description": "The category of the secret: env_var for regular environment variables, ai_provider for AI provider API keys" } }, "required": [ "id", "object_type", "object_id", "name" ] }, "MCPServer": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the MCP server" }, "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the MCP server belongs under" }, "user_id": { "type": "string", "nullable": true, "format": "uuid", "description": "Identifies the user who created the MCP server" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of MCP server creation" }, "deleted_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of MCP server deletion, or null if the MCP server is still active" }, "name": { "type": "string", "description": "Name of the MCP server. Within a project, MCP server names are unique" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the MCP server" }, "url": { "type": "string", "description": "URL of the MCP server endpoint" } }, "required": [ "id", "project_id", "name", "url" ] }, "CreateMCPServer": { "type": "object", "properties": { "project_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the project that the MCP server belongs under" }, "name": { "type": "string", "description": "Name of the MCP server. Within a project, MCP server names are unique" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the MCP server" }, "url": { "type": "string", "description": "URL of the MCP server endpoint" } }, "required": [ "project_id", "name", "url" ] }, "PatchMCPServer": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the MCP server. Within a project, MCP server names are unique" }, "url": { "type": "string", "nullable": true, "description": "URL of the MCP server endpoint" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the MCP server" } } }, "DatasetSnapshot": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the dataset snapshot" }, "dataset_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the dataset that this snapshot belongs to" }, "name": { "type": "string", "description": "Name of the dataset snapshot" }, "description": { "type": "string", "nullable": true }, "xact_id": { "type": "string", "description": "Transaction id of the brainstore version at the time of the snapshot" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of dataset snapshot creation" } }, "required": [ "id", "dataset_id", "name", "description", "xact_id", "created" ] }, "CreateDatasetSnapshot": { "type": "object", "properties": { "dataset_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the dataset that this snapshot belongs to" }, "name": { "type": "string", "minLength": 1, "description": "Name of the dataset snapshot" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the dataset snapshot" }, "xact_id": { "type": "string", "minLength": 1, "description": "Transaction id of the brainstore version at the time of the snapshot" } }, "required": [ "dataset_id", "name", "xact_id" ] }, "PatchDatasetSnapshot": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the dataset snapshot" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the dataset snapshot" } } }, "Environment": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the environment" }, "org_id": { "type": "string", "format": "uuid", "description": "Unique identifier for the organization that the environment belongs under" }, "name": { "type": "string", "description": "Name of the environment" }, "slug": { "type": "string", "description": "A url-friendly, unique identifier for the environment within an organization" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the environment" }, "created": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of environment creation" }, "deleted_at": { "type": "string", "nullable": true, "format": "date-time", "description": "Date of environment deletion, or null if the environment is still active" } }, "required": [ "id", "org_id", "name", "slug" ] }, "CreateEnvironment": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the environment" }, "slug": { "type": "string", "description": "A url-friendly, unique identifier for the environment within an organization" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the environment" }, "org_name": { "type": "string", "nullable": true, "description": "For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, you may specify the name of the organization the environment belongs in." } }, "required": [ "name", "slug" ] }, "PatchEnvironment": { "type": "object", "properties": { "name": { "type": "string", "nullable": true, "description": "Name of the environment" }, "slug": { "type": "string", "nullable": true, "description": "A url-friendly, unique identifier for the environment within an organization" }, "description": { "type": "string", "nullable": true, "description": "Textual description of the environment" } } }, "CrossObjectInsertResponse": { "type": "object", "properties": { "experiment": { "type": "object", "nullable": true, "additionalProperties": { "$ref": "#/components/schemas/InsertEventsResponse" }, "description": "A mapping from experiment id to row ids for inserted `events`" }, "dataset": { "type": "object", "nullable": true, "additionalProperties": { "$ref": "#/components/schemas/InsertEventsResponse" }, "description": "A mapping from dataset id to row ids for inserted `events`" }, "project_logs": { "type": "object", "nullable": true, "additionalProperties": { "$ref": "#/components/schemas/InsertEventsResponse" }, "description": "A mapping from project id to row ids for inserted `events`" } } }, "CrossObjectInsertRequest": { "type": "object", "properties": { "experiment": { "type": "object", "nullable": true, "additionalProperties": { "type": "object", "properties": { "events": { "type": "array", "nullable": true, "items": { "$ref": "#/components/schemas/InsertExperimentEvent" }, "description": "A list of experiment events to insert" }, "feedback": { "type": "array", "nullable": true, "items": { "$ref": "#/components/schemas/FeedbackExperimentItem" }, "description": "A list of experiment feedback items" } } }, "description": "A mapping from experiment id to a set of log events and feedback items to insert" }, "dataset": { "type": "object", "nullable": true, "additionalProperties": { "type": "object", "properties": { "events": { "type": "array", "nullable": true, "items": { "$ref": "#/components/schemas/InsertDatasetEvent" }, "description": "A list of dataset events to insert" }, "feedback": { "type": "array", "nullable": true, "items": { "$ref": "#/components/schemas/FeedbackDatasetItem" }, "description": "A list of dataset feedback items" } } }, "description": "A mapping from dataset id to a set of log events and feedback items to insert" }, "project_logs": { "type": "object", "nullable": true, "additionalProperties": { "type": "object", "properties": { "events": { "type": "array", "nullable": true, "items": { "$ref": "#/components/schemas/InsertProjectLogsEvent" }, "description": "A list of project logs events to insert" }, "feedback": { "type": "array", "nullable": true, "items": { "$ref": "#/components/schemas/FeedbackProjectLogsItem" }, "description": "A list of project logs feedback items" } } }, "description": "A mapping from project id to a set of log events and feedback items to insert" } } }, "PromptData": { "type": "object", "properties": { "prompt": { "$ref": "#/components/schemas/PromptBlockDataNullish" }, "options": { "$ref": "#/components/schemas/PromptOptionsNullish" }, "parser": { "$ref": "#/components/schemas/PromptParserNullish" }, "tool_functions": { "type": "array", "nullable": true, "items": { "allOf": [ { "$ref": "#/components/schemas/SavedFunctionId" }, { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "function" ] }, "id": { "type": "string" }, "version": { "type": "string", "description": "The version of the function" } }, "required": [ "type", "id" ], "title": "function" }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "global" ] }, "name": { "type": "string" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" } }, "required": [ "type", "name" ], "title": "global" } ] } ] } }, "template_format": { "type": "string", "nullable": true, "enum": [ "mustache", "nunjucks", "none", null ] }, "mcp": { "type": "object", "nullable": true, "additionalProperties": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "id" ] }, "id": { "type": "string", "format": "uuid" }, "is_disabled": { "type": "boolean" }, "enabled_tools": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "If omitted, all tools are enabled" } }, "required": [ "type", "id" ], "title": "MCP server id. This is used for project-level MCP server definitions." }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "url" ] }, "url": { "type": "string" }, "is_disabled": { "type": "boolean" }, "enabled_tools": { "type": "array", "nullable": true, "items": { "type": "string" }, "description": "If omitted, all tools are enabled" } }, "required": [ "type", "url" ], "title": "MCP server url. This is used for inline definitions of MCP servers." } ] } }, "origin": { "type": "object", "nullable": true, "properties": { "prompt_id": { "type": "string" }, "project_id": { "type": "string" }, "prompt_version": { "type": "string" } } } } }, "FunctionId": { "anyOf": [ { "type": "object", "properties": { "function_id": { "type": "string", "description": "The ID of the function" }, "version": { "type": "string", "description": "The version of the function" } }, "required": [ "function_id" ], "description": "Function id", "title": "function_id" }, { "type": "object", "properties": { "project_name": { "type": "string", "description": "The name of the project containing the function" }, "slug": { "type": "string", "description": "The slug of the function" }, "version": { "type": "string", "description": "The version of the function" } }, "required": [ "project_name", "slug" ], "description": "Project name and slug", "title": "project_slug" }, { "type": "object", "properties": { "global_function": { "type": "string", "description": "The name of the global function. Currently, the global namespace includes the functions in autoevals" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" } }, "required": [ "global_function" ], "description": "Global function name", "title": "global_function" }, { "type": "object", "properties": { "prompt_session_id": { "type": "string", "description": "The ID of the prompt session" }, "prompt_session_function_id": { "type": "string", "description": "The ID of the function in the prompt session" }, "version": { "type": "string", "description": "The version of the function" } }, "required": [ "prompt_session_id", "prompt_session_function_id" ], "description": "Prompt session id", "title": "prompt_session_id" }, { "type": "object", "properties": { "inline_context": { "type": "object", "properties": { "runtime": { "type": "string", "enum": [ "node", "python", "browser", "quickjs" ] }, "version": { "type": "string" } }, "required": [ "runtime", "version" ] }, "code": { "type": "string", "description": "The inline code to execute" }, "function_type": { "allOf": [ { "$ref": "#/components/schemas/FunctionTypeEnum" }, { "description": "The function type for inline code. Required when invoking inline preprocessors." } ] }, "name": { "type": "string", "nullable": true, "description": "The name of the inline code function" } }, "required": [ "inline_context", "code" ], "description": "Inline code function", "title": "inline_code" }, { "type": "object", "properties": { "inline_prompt": { "$ref": "#/components/schemas/PromptData" }, "inline_function": { "type": "object", "additionalProperties": { "nullable": true } }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" }, "name": { "type": "string", "nullable": true, "description": "The name of the inline function" } }, "required": [ "inline_function" ], "description": "Inline function definition", "title": "inline_function" }, { "type": "object", "properties": { "inline_prompt": { "$ref": "#/components/schemas/PromptData" }, "function_type": { "$ref": "#/components/schemas/FunctionTypeEnum" }, "name": { "type": "string", "nullable": true, "description": "The name of the inline prompt" } }, "required": [ "inline_prompt" ], "description": "Inline prompt definition", "title": "inline_prompt" } ], "description": "The function to evaluate" }, "GitMetadataSettings": { "type": "object", "nullable": true, "properties": { "collect": { "type": "string", "enum": [ "all", "none", "some" ] }, "fields": { "type": "array", "items": { "type": "string", "enum": [ "commit", "branch", "tag", "dirty", "author_name", "author_email", "commit_message", "commit_time", "git_diff" ] } } }, "required": [ "collect" ], "additionalProperties": false, "description": "Optional settings for collecting git metadata. By default, will collect all git metadata fields allowed in org-level settings." }, "RunEval": { "type": "object", "properties": { "project_id": { "type": "string", "description": "Unique identifier for the project to run the eval in" }, "data": { "anyOf": [ { "type": "object", "properties": { "dataset_id": { "type": "string" }, "dataset_version": { "type": "string", "nullable": true, "description": "The version of the dataset to evaluate" }, "dataset_environment": { "type": "string", "nullable": true, "description": "The environment tag that resolves to the dataset version to evaluate" }, "_internal_btql": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } } }, "required": [ "dataset_id" ], "description": "Dataset id", "title": "dataset_id" }, { "type": "object", "properties": { "project_name": { "type": "string" }, "dataset_name": { "type": "string" }, "dataset_version": { "type": "string", "nullable": true, "description": "The version of the dataset to evaluate" }, "dataset_environment": { "type": "string", "nullable": true, "description": "The environment tag that resolves to the dataset version to evaluate" }, "_internal_btql": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } } }, "required": [ "project_name", "dataset_name" ], "description": "Project and dataset name", "title": "project_dataset_name" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "nullable": true } } }, "required": [ "data" ], "description": "Dataset rows", "title": "dataset_rows" } ], "description": "The dataset to use" }, "name": { "type": "string", "description": "The name of the eval to run when multiple evals available" }, "parameters": { "type": "object", "additionalProperties": { "nullable": true }, "description": "Values for any parameters used in the eval" }, "task": { "$ref": "#/components/schemas/FunctionId" }, "scores": { "type": "array", "items": { "allOf": [ { "$ref": "#/components/schemas/FunctionId" }, { "description": "Options for identifying a function" } ] }, "description": "The functions to score the eval on" }, "experiment_name": { "type": "string", "description": "An optional name for the experiment created by this eval. If it conflicts with an existing experiment, it will be suffixed with a unique identifier." }, "metadata": { "type": "object", "additionalProperties": { "nullable": true }, "description": "Optional experiment-level metadata to store about the evaluation. You can later use this to slice & dice across experiments." }, "parent": { "allOf": [ { "$ref": "#/components/schemas/InvokeParent" }, { "description": "Options for tracing the evaluation" } ] }, "stream": { "type": "boolean", "description": "Whether to stream the results of the eval. If true, the request will return two events: one to indicate the experiment has started, and another upon completion. If false, the request will return the evaluation's summary upon completion." }, "trial_count": { "type": "number", "nullable": true, "description": "The number of times to run the evaluator per input. This is useful for evaluating applications that have non-deterministic behavior and gives you both a stronger aggregate measure and a sense of the variance in the results." }, "is_public": { "type": "boolean", "nullable": true, "description": "Whether the experiment should be public. Defaults to false." }, "timeout": { "type": "number", "nullable": true, "description": "The maximum duration, in milliseconds, to run the evaluation. Defaults to undefined, in which case there is no timeout." }, "max_concurrency": { "type": "number", "nullable": true, "default": 10, "description": "The maximum number of tasks/scorers that will be run concurrently. Defaults to 10. If null is provided, no max concurrency will be used." }, "base_experiment_name": { "type": "string", "nullable": true, "description": "An optional experiment name to use as a base. If specified, the new experiment will be summarized and compared to this experiment." }, "base_experiment_id": { "type": "string", "nullable": true, "description": "An optional experiment id to use as a base. If specified, the new experiment will be summarized and compared to this experiment." }, "git_metadata_settings": { "$ref": "#/components/schemas/GitMetadataSettings" }, "repo_info": { "allOf": [ { "$ref": "#/components/schemas/RepoInfo" }, { "description": "Optionally explicitly specify the git metadata for this experiment. This takes precedence over `gitMetadataSettings` if specified." } ] }, "strict": { "type": "boolean", "nullable": true, "description": "If true, throw an error if one of the variables in the prompt is not present in the input" }, "stop_token": { "type": "string", "nullable": true, "description": "The token to stop the run" }, "extra_messages": { "type": "string", "description": "A template path of extra messages to append to the conversion. These messages will be appended to the end of the conversation, after the last message." }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Optional tags that will be added to the experiment." }, "mcp_auth": { "type": "object", "additionalProperties": { "type": "object", "properties": { "oauth_token": { "type": "string", "description": "The OAuth token to use" } } } } }, "required": [ "project_id", "data", "task", "scores" ] } }, "parameters": { "ProjectIdParam": { "schema": { "$ref": "#/components/schemas/ProjectIdParam" }, "required": true, "description": "Project id", "name": "project_id", "in": "path" }, "ExperimentIdParam": { "schema": { "$ref": "#/components/schemas/ExperimentIdParam" }, "required": true, "description": "Experiment id", "name": "experiment_id", "in": "path" }, "DatasetIdParam": { "schema": { "$ref": "#/components/schemas/DatasetIdParam" }, "required": true, "description": "Dataset id", "name": "dataset_id", "in": "path" }, "PromptIdParam": { "schema": { "$ref": "#/components/schemas/PromptIdParam" }, "required": true, "description": "Prompt id", "name": "prompt_id", "in": "path" }, "PromptSessionIdParam": { "schema": { "$ref": "#/components/schemas/PromptSessionIdParam" }, "required": true, "description": "PromptSession id", "name": "prompt_session_id", "in": "path" }, "RoleIdParam": { "schema": { "$ref": "#/components/schemas/RoleIdParam" }, "required": true, "description": "Role id", "name": "role_id", "in": "path" }, "GroupIdParam": { "schema": { "$ref": "#/components/schemas/GroupIdParam" }, "required": true, "description": "Group id", "name": "group_id", "in": "path" }, "AclIdParam": { "schema": { "$ref": "#/components/schemas/AclIdParam" }, "required": true, "description": "Acl id", "name": "acl_id", "in": "path" }, "UserIdParam": { "schema": { "$ref": "#/components/schemas/UserIdParam" }, "required": true, "description": "User id", "name": "user_id", "in": "path" }, "ProjectAutomationIdParam": { "schema": { "$ref": "#/components/schemas/ProjectAutomationIdParam" }, "required": true, "description": "ProjectAutomation id", "name": "project_automation_id", "in": "path" }, "ProjectScoreIdParam": { "schema": { "$ref": "#/components/schemas/ProjectScoreIdParam" }, "required": true, "description": "ProjectScore id", "name": "project_score_id", "in": "path" }, "ProjectTagIdParam": { "schema": { "$ref": "#/components/schemas/ProjectTagIdParam" }, "required": true, "description": "ProjectTag id", "name": "project_tag_id", "in": "path" }, "SpanIframeIdParam": { "schema": { "$ref": "#/components/schemas/SpanIframeIdParam" }, "required": true, "description": "SpanIframe id", "name": "span_iframe_id", "in": "path" }, "FunctionIdParam": { "schema": { "$ref": "#/components/schemas/FunctionIdParam" }, "required": true, "description": "Function id", "name": "function_id", "in": "path" }, "ViewIdParam": { "schema": { "$ref": "#/components/schemas/ViewIdParam" }, "required": true, "description": "View id", "name": "view_id", "in": "path" }, "OrganizationIdParam": { "schema": { "$ref": "#/components/schemas/OrganizationIdParam" }, "required": true, "description": "Organization id", "name": "organization_id", "in": "path" }, "ApiKeyIdParam": { "schema": { "$ref": "#/components/schemas/ApiKeyIdParam" }, "required": true, "description": "ApiKey id", "name": "api_key_id", "in": "path" }, "ServiceTokenIdParam": { "schema": { "$ref": "#/components/schemas/ServiceTokenIdParam" }, "required": true, "description": "ServiceToken id", "name": "service_token_id", "in": "path" }, "AiSecretIdParam": { "schema": { "$ref": "#/components/schemas/AiSecretIdParam" }, "required": true, "description": "AiSecret id", "name": "ai_secret_id", "in": "path" }, "EnvVarIdParam": { "schema": { "$ref": "#/components/schemas/EnvVarIdParam" }, "required": true, "description": "EnvVar id", "name": "env_var_id", "in": "path" }, "McpServerIdParam": { "schema": { "$ref": "#/components/schemas/McpServerIdParam" }, "required": true, "description": "McpServer id", "name": "mcp_server_id", "in": "path" }, "DatasetSnapshotIdParam": { "schema": { "$ref": "#/components/schemas/DatasetSnapshotIdParam" }, "required": true, "description": "DatasetSnapshot id", "name": "dataset_snapshot_id", "in": "path" }, "ProjectIdQuery": { "schema": { "$ref": "#/components/schemas/ProjectIdQuery" }, "required": false, "description": "Project id", "name": "project_id", "in": "query" }, "ProjectName": { "schema": { "$ref": "#/components/schemas/ProjectName" }, "required": false, "description": "Name of the project to search for", "name": "project_name", "in": "query", "allowReserved": true }, "ExperimentName": { "schema": { "$ref": "#/components/schemas/ExperimentName" }, "required": false, "description": "Name of the experiment to search for", "name": "experiment_name", "in": "query", "allowReserved": true }, "DatasetName": { "schema": { "$ref": "#/components/schemas/DatasetName" }, "required": false, "description": "Name of the dataset to search for", "name": "dataset_name", "in": "query", "allowReserved": true }, "PromptName": { "schema": { "$ref": "#/components/schemas/PromptName" }, "required": false, "description": "Name of the prompt to search for", "name": "prompt_name", "in": "query", "allowReserved": true }, "PromptSessionName": { "schema": { "$ref": "#/components/schemas/PromptSessionName" }, "required": false, "description": "Name of the prompt_session to search for", "name": "prompt_session_name", "in": "query", "allowReserved": true }, "RoleName": { "schema": { "$ref": "#/components/schemas/RoleName" }, "required": false, "description": "Name of the role to search for", "name": "role_name", "in": "query", "allowReserved": true }, "GroupName": { "schema": { "$ref": "#/components/schemas/GroupName" }, "required": false, "description": "Name of the group to search for", "name": "group_name", "in": "query", "allowReserved": true }, "ProjectAutomationName": { "schema": { "$ref": "#/components/schemas/ProjectAutomationName" }, "required": false, "description": "Name of the project_automation to search for", "name": "project_automation_name", "in": "query", "allowReserved": true }, "ProjectScoreName": { "schema": { "$ref": "#/components/schemas/ProjectScoreName" }, "required": false, "description": "Name of the project_score to search for", "name": "project_score_name", "in": "query", "allowReserved": true }, "ProjectTagName": { "schema": { "$ref": "#/components/schemas/ProjectTagName" }, "required": false, "description": "Name of the project_tag to search for", "name": "project_tag_name", "in": "query", "allowReserved": true }, "SpanIframeName": { "schema": { "$ref": "#/components/schemas/SpanIframeName" }, "required": false, "description": "Name of the span_iframe to search for", "name": "span_iframe_name", "in": "query", "allowReserved": true }, "FunctionName": { "schema": { "$ref": "#/components/schemas/FunctionName" }, "required": false, "description": "Name of the function to search for", "name": "function_name", "in": "query", "allowReserved": true }, "ViewName": { "schema": { "$ref": "#/components/schemas/ViewName" }, "required": false, "description": "Name of the view to search for", "name": "view_name", "in": "query", "allowReserved": true }, "ApiKeyName": { "schema": { "$ref": "#/components/schemas/ApiKeyName" }, "required": false, "description": "Name of the api_key to search for", "name": "api_key_name", "in": "query", "allowReserved": true }, "ServiceTokenName": { "schema": { "$ref": "#/components/schemas/ServiceTokenName" }, "required": false, "description": "Name of the service_token to search for", "name": "service_token_name", "in": "query", "allowReserved": true }, "AiSecretName": { "schema": { "$ref": "#/components/schemas/AiSecretName" }, "required": false, "description": "Name of the ai_secret to search for", "name": "ai_secret_name", "in": "query", "allowReserved": true }, "EnvVarName": { "schema": { "$ref": "#/components/schemas/EnvVarName" }, "required": false, "description": "Name of the env_var to search for", "name": "env_var_name", "in": "query", "allowReserved": true }, "McpServerName": { "schema": { "$ref": "#/components/schemas/McpServerName" }, "required": false, "description": "Name of the mcp_server to search for", "name": "mcp_server_name", "in": "query", "allowReserved": true }, "DatasetSnapshotName": { "schema": { "$ref": "#/components/schemas/DatasetSnapshotName" }, "required": false, "description": "Name of the dataset_snapshot to search for", "name": "dataset_snapshot_name", "in": "query", "allowReserved": true }, "OrgName": { "schema": { "$ref": "#/components/schemas/OrgName" }, "required": false, "description": "Filter search results to within a particular organization", "name": "org_name", "in": "query", "allowReserved": true }, "Ids": { "schema": { "$ref": "#/components/schemas/Ids" }, "required": false, "description": "Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times", "name": "ids", "in": "query" }, "AppLimitParam": { "schema": { "$ref": "#/components/schemas/AppLimitParam" }, "required": false, "description": "Limit the number of objects to return", "name": "limit", "in": "query" }, "AppLimitWithDefaultParam": { "schema": { "$ref": "#/components/schemas/AppLimitWithDefaultParam" }, "required": false, "description": "Limit the number of objects to return", "name": "limit", "in": "query" }, "FetchLimitParam": { "schema": { "$ref": "#/components/schemas/FetchLimitParam" }, "required": false, "description": "limit the number of traces fetched\n\nFetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.\n\nThe `limit` parameter controls the number of full traces to return. So you may end up with more individual rows than the specified limit if you are fetching events containing traces.", "name": "limit", "in": "query" }, "StartingAfter": { "schema": { "$ref": "#/components/schemas/StartingAfter" }, "required": false, "description": "Pagination cursor id.\n\nFor example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before`", "name": "starting_after", "in": "query" }, "EndingBefore": { "schema": { "$ref": "#/components/schemas/EndingBefore" }, "required": false, "description": "Pagination cursor id.\n\nFor example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before`", "name": "ending_before", "in": "query" }, "MaxXactId": { "schema": { "$ref": "#/components/schemas/MaxXactId" }, "required": false, "description": "DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.\n\nTogether, `max_xact_id` and `max_root_span_id` form a pagination cursor\n\nSince a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries.", "name": "max_xact_id", "in": "query" }, "MaxRootSpanId": { "schema": { "$ref": "#/components/schemas/MaxRootSpanId" }, "required": false, "description": "DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.\n\nTogether, `max_xact_id` and `max_root_span_id` form a pagination cursor\n\nSince a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries.", "name": "max_root_span_id", "in": "query" }, "Version": { "schema": { "$ref": "#/components/schemas/Version" }, "required": false, "description": "Retrieve a snapshot of events from a past time\n\nThe version id is essentially a filter on the latest event transaction id. You can use the `max_xact_id` returned by a past fetch as the version to reproduce that exact fetch.", "name": "version", "in": "query" }, "PromptVersion": { "schema": { "$ref": "#/components/schemas/PromptVersion" }, "required": false, "description": "Retrieve prompt at a specific version.\n\nThe version id can either be a transaction id (e.g. '1000192656880881099') or a version identifier (e.g. '81cd05ee665fdfb3').", "name": "version", "in": "query" }, "PromptEnvironment": { "schema": { "$ref": "#/components/schemas/PromptEnvironment" }, "required": false, "description": "Filter by environment slug. Cannot be used together with `version`.\n\nFor `GET /v1/prompt`, environment resolution currently requires the request to match a single prompt. If multiple prompts match, the endpoint returns `400` (for example when `limit=1` is not set). Use `limit=1` or other filters (for example `slug`, `project_id`) to narrow results.", "name": "environment", "in": "query", "allowReserved": true }, "SummarizeScores": { "schema": { "$ref": "#/components/schemas/SummarizeScores" }, "required": false, "description": "Whether to summarize the scores and metrics. If false (or omitted), only the metadata will be returned.", "name": "summarize_scores", "in": "query" }, "ComparisonExperimentId": { "schema": { "$ref": "#/components/schemas/ComparisonExperimentId" }, "required": false, "description": "The experiment to compare against, if summarizing scores and metrics. If omitted, will fall back to the `base_exp_id` stored in the experiment metadata, and then to the most recent experiment run in the same project. Must pass `summarize_scores=true` for this id to be used", "name": "comparison_experiment_id", "in": "query" }, "SummarizeData": { "schema": { "$ref": "#/components/schemas/SummarizeData" }, "required": false, "description": "Whether to summarize the data. If false (or omitted), only the metadata will be returned.", "name": "summarize_data", "in": "query" }, "Slug": { "schema": { "$ref": "#/components/schemas/Slug" }, "required": false, "description": "Retrieve prompt with a specific slug", "name": "slug", "in": "query", "allowReserved": true }, "ViewType": { "schema": { "$ref": "#/components/schemas/ViewType" }, "required": false, "description": "Type of object that the view corresponds to.", "name": "view_type", "in": "query" }, "UserGivenName": { "schema": { "$ref": "#/components/schemas/UserGivenName" }, "required": false, "description": "Given name of the user to search for. You may pass the param multiple times to filter for more than one given name", "name": "given_name", "in": "query", "allowReserved": true }, "UserFamilyName": { "schema": { "$ref": "#/components/schemas/UserFamilyName" }, "required": false, "description": "Family name of the user to search for. You may pass the param multiple times to filter for more than one family name", "name": "family_name", "in": "query", "allowReserved": true }, "UserEmail": { "schema": { "$ref": "#/components/schemas/UserEmail" }, "required": false, "description": "Email of the user to search for. You may pass the param multiple times to filter for more than one email", "name": "email", "in": "query", "allowReserved": true }, "AclObjectType": { "schema": { "$ref": "#/components/schemas/AclObjectType" }, "required": true, "description": "The object type that the ACL applies to", "name": "object_type", "in": "query" }, "AclObjectId": { "schema": { "$ref": "#/components/schemas/AclObjectId" }, "required": true, "description": "The id of the object the ACL applies to", "name": "object_id", "in": "query" }, "AclListOrgObjectType": { "schema": { "$ref": "#/components/schemas/AclListOrgObjectType" }, "required": false, "description": "The object type that the ACL applies to", "name": "object_type", "in": "query" }, "AclListOrgObjectId": { "schema": { "$ref": "#/components/schemas/AclListOrgObjectId" }, "required": false, "description": "The id of the object the ACL applies to", "name": "object_id", "in": "query" }, "AclListUserId": { "schema": { "$ref": "#/components/schemas/AclListUserId" }, "required": false, "description": "Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will be provided", "name": "user_id", "in": "query" }, "AclListGroupId": { "schema": { "$ref": "#/components/schemas/AclListGroupId" }, "required": false, "description": "Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will be provided", "name": "group_id", "in": "query" }, "AclListPermission": { "schema": { "$ref": "#/components/schemas/AclListPermission" }, "required": false, "description": "Each permission permits a certain type of operation on an object in the system\n\nPermissions can be assigned to to objects on an individual basis, or grouped into roles", "name": "permission", "in": "query" }, "AclListRestrictObjectType": { "schema": { "$ref": "#/components/schemas/AclListRestrictObjectType" }, "required": false, "description": "The object type that the ACL applies to", "name": "restrict_object_type", "in": "query" }, "AclListRoleId": { "schema": { "$ref": "#/components/schemas/AclListRoleId" }, "required": false, "description": "Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be provided", "name": "role_id", "in": "query" }, "ProjectScoreType": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/ProjectScoreType" }, { "type": "array", "items": { "allOf": [ { "$ref": "#/components/schemas/ProjectScoreType" }, { "title": "project_score_type" } ] } } ] }, "required": false, "name": "score_type", "in": "query" }, "AISecretType": { "schema": { "$ref": "#/components/schemas/AISecretType" }, "required": false, "name": "ai_secret_type", "in": "query" }, "EnvVarObjectType": { "schema": { "$ref": "#/components/schemas/EnvVarObjectType" }, "required": false, "description": "The type of the object the environment variable is scoped for", "name": "object_type", "in": "query" }, "EnvVarObjectId": { "schema": { "$ref": "#/components/schemas/EnvVarObjectId" }, "required": false, "description": "The id of the object the environment variable is scoped for", "name": "object_id", "in": "query" } } }, "paths": { "/v1/project": { "post": { "tags": [ "Projects" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postProject", "description": "Create a new project. If there is an existing project with the same name as the one specified in the request, will return the existing project unmodified", "summary": "Create project", "requestBody": { "description": "Any desired information about the new project object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateProject" } } } }, "responses": { "200": { "description": "Returns the new project object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Project" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getProject", "tags": [ "Projects" ], "description": "List out all projects. The projects are sorted by creation date, with the most recently-created projects coming first", "summary": "List projects", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/ProjectName" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of project objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/Project" }, "description": "A list of project objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProject", "description": "Enable CORS", "summary": "Enable CORS (`/v1/project`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/project/{project_id}": { "get": { "operationId": "getProjectId", "tags": [ "Projects" ], "description": "Get a project object by its id", "summary": "Get project", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectIdParam" } ], "responses": { "200": { "description": "Returns the project object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Project" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchProjectId", "tags": [ "Projects" ], "description": "Partially update a project object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update project", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchProject" } } } }, "responses": { "200": { "description": "Returns the project object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Project" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteProjectId", "tags": [ "Projects" ], "description": "Delete a project object by its id", "summary": "Delete project", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectIdParam" } ], "responses": { "200": { "description": "Returns the deleted project object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Project" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProjectId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/project/{project_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ProjectIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/project_logs/{project_id}/insert": { "post": { "operationId": "postProjectLogsIdInsert", "tags": [ "Logs" ], "description": "Insert a set of events into the project logs", "summary": "Insert project logs events", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectIdParam" } ], "requestBody": { "description": "An array of project logs events to insert", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InsertProjectLogsEventRequest" } } } }, "responses": { "200": { "description": "Returns the inserted row ids", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InsertEventsResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProjectLogsIdInsert", "description": "Enable CORS", "summary": "Enable CORS (`/v1/project_logs/{project_id}/insert`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ProjectIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/project_logs/{project_id}/fetch": { "post": { "operationId": "postProjectLogsIdFetch", "tags": [ "Logs" ], "description": "Fetch the events in a project logs. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.", "summary": "Fetch project logs (POST form)", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectIdParam" } ], "requestBody": { "description": "Filters for the fetch query", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FetchEventsRequest" } } } }, "responses": { "200": { "description": "Returns the fetched rows", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FetchProjectLogsEventsResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getProjectLogsIdFetch", "tags": [ "Logs" ], "description": "Fetch the events in a project logs. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.", "summary": "Fetch project logs (GET form)", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectIdParam" }, { "$ref": "#/components/parameters/FetchLimitParam" }, { "$ref": "#/components/parameters/MaxXactId" }, { "$ref": "#/components/parameters/MaxRootSpanId" }, { "$ref": "#/components/parameters/Version" } ], "responses": { "200": { "description": "Returns the fetched rows", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FetchProjectLogsEventsResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProjectLogsIdFetch", "description": "Enable CORS", "summary": "Enable CORS (`/v1/project_logs/{project_id}/fetch`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ProjectIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/project_logs/{project_id}/feedback": { "post": { "operationId": "postProjectLogsIdFeedback", "tags": [ "Logs" ], "description": "Log feedback for a set of project logs events", "summary": "Feedback for project logs events", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectIdParam" } ], "requestBody": { "description": "An array of feedback objects", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackProjectLogsEventRequest" } } } }, "responses": { "200": { "description": "Returns a success status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackResponseSchema" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProjectLogsIdFeedback", "description": "Enable CORS", "summary": "Enable CORS (`/v1/project_logs/{project_id}/feedback`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ProjectIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/experiment": { "post": { "tags": [ "Experiments" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postExperiment", "description": "Create a new experiment. If there is an existing experiment in the project with the same name as the one specified in the request, will return the existing experiment unmodified", "summary": "Create experiment", "requestBody": { "description": "Any desired information about the new experiment object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateExperiment" } } } }, "responses": { "200": { "description": "Returns the new experiment object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Experiment" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getExperiment", "tags": [ "Experiments" ], "description": "List out all experiments. The experiments are sorted by creation date, with the most recently-created experiments coming first", "summary": "List experiments", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitWithDefaultParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/ExperimentName" }, { "$ref": "#/components/parameters/ProjectName" }, { "$ref": "#/components/parameters/ProjectIdQuery" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of experiment objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/Experiment" }, "description": "A list of experiment objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsExperiment", "description": "Enable CORS", "summary": "Enable CORS (`/v1/experiment`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/experiment/{experiment_id}": { "get": { "operationId": "getExperimentId", "tags": [ "Experiments" ], "description": "Get an experiment object by its id", "summary": "Get experiment", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" } ], "responses": { "200": { "description": "Returns the experiment object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Experiment" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchExperimentId", "tags": [ "Experiments" ], "description": "Partially update an experiment object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update experiment", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchExperiment" } } } }, "responses": { "200": { "description": "Returns the experiment object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Experiment" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteExperimentId", "tags": [ "Experiments" ], "description": "Delete an experiment object by its id", "summary": "Delete experiment", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" } ], "responses": { "200": { "description": "Returns the deleted experiment object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Experiment" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsExperimentId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/experiment/{experiment_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/experiment/{experiment_id}/insert": { "post": { "operationId": "postExperimentIdInsert", "tags": [ "Experiments" ], "description": "Insert a set of events into the experiment", "summary": "Insert experiment events", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" } ], "requestBody": { "description": "An array of experiment events to insert", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InsertExperimentEventRequest" } } } }, "responses": { "200": { "description": "Returns the inserted row ids", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InsertEventsResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsExperimentIdInsert", "description": "Enable CORS", "summary": "Enable CORS (`/v1/experiment/{experiment_id}/insert`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/experiment/{experiment_id}/fetch": { "post": { "operationId": "postExperimentIdFetch", "tags": [ "Experiments" ], "description": "Fetch the events in an experiment. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.", "summary": "Fetch experiment (POST form)", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" } ], "requestBody": { "description": "Filters for the fetch query", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FetchEventsRequest" } } } }, "responses": { "200": { "description": "Returns the fetched rows", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FetchExperimentEventsResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getExperimentIdFetch", "tags": [ "Experiments" ], "description": "Fetch the events in an experiment. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.", "summary": "Fetch experiment (GET form)", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" }, { "$ref": "#/components/parameters/FetchLimitParam" }, { "$ref": "#/components/parameters/MaxXactId" }, { "$ref": "#/components/parameters/MaxRootSpanId" }, { "$ref": "#/components/parameters/Version" } ], "responses": { "200": { "description": "Returns the fetched rows", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FetchExperimentEventsResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsExperimentIdFetch", "description": "Enable CORS", "summary": "Enable CORS (`/v1/experiment/{experiment_id}/fetch`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/experiment/{experiment_id}/feedback": { "post": { "operationId": "postExperimentIdFeedback", "tags": [ "Experiments" ], "description": "Log feedback for a set of experiment events", "summary": "Feedback for experiment events", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" } ], "requestBody": { "description": "An array of feedback objects", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackExperimentEventRequest" } } } }, "responses": { "200": { "description": "Returns a success status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackResponseSchema" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsExperimentIdFeedback", "description": "Enable CORS", "summary": "Enable CORS (`/v1/experiment/{experiment_id}/feedback`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/experiment/{experiment_id}/summarize": { "get": { "operationId": "getExperimentIdSummarize", "tags": [ "Experiments" ], "description": "Summarize experiment", "summary": "Summarize experiment", "security": [ { "bearerAuth": [] } ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" }, { "$ref": "#/components/parameters/SummarizeScores" }, { "$ref": "#/components/parameters/ComparisonExperimentId" } ], "responses": { "200": { "description": "Experiment summary", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SummarizeExperimentResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsExperimentIdSummarize", "description": "Enable CORS", "summary": "Enable CORS (`/v1/experiment/{experiment_id}/summarize`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ExperimentIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/dataset": { "post": { "tags": [ "Datasets" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postDataset", "description": "Create a new dataset. If there is an existing dataset in the project with the same name as the one specified in the request, will return the existing dataset unmodified", "summary": "Create dataset", "requestBody": { "description": "Any desired information about the new dataset object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateDataset" } } } }, "responses": { "200": { "description": "Returns the new dataset object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Dataset" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getDataset", "tags": [ "Datasets" ], "description": "List out all datasets. The datasets are sorted by creation date, with the most recently-created datasets coming first", "summary": "List datasets", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/DatasetName" }, { "$ref": "#/components/parameters/ProjectName" }, { "$ref": "#/components/parameters/ProjectIdQuery" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of dataset objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/Dataset" }, "description": "A list of dataset objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsDataset", "description": "Enable CORS", "summary": "Enable CORS (`/v1/dataset`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/dataset/{dataset_id}": { "get": { "operationId": "getDatasetId", "tags": [ "Datasets" ], "description": "Get a dataset object by its id", "summary": "Get dataset", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { "200": { "description": "Returns the dataset object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Dataset" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchDatasetId", "tags": [ "Datasets" ], "description": "Partially update a dataset object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update dataset", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchDataset" } } } }, "responses": { "200": { "description": "Returns the dataset object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Dataset" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteDatasetId", "tags": [ "Datasets" ], "description": "Delete a dataset object by its id", "summary": "Delete dataset", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { "200": { "description": "Returns the deleted dataset object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Dataset" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsDatasetId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/dataset/{dataset_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/dataset/{dataset_id}/insert": { "post": { "operationId": "postDatasetIdInsert", "tags": [ "Datasets" ], "description": "Insert a set of events into the dataset", "summary": "Insert dataset events", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" } ], "requestBody": { "description": "An array of dataset events to insert", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InsertDatasetEventRequest" } } } }, "responses": { "200": { "description": "Returns the inserted row ids", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InsertEventsResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsDatasetIdInsert", "description": "Enable CORS", "summary": "Enable CORS (`/v1/dataset/{dataset_id}/insert`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/dataset/{dataset_id}/fetch": { "post": { "operationId": "postDatasetIdFetch", "tags": [ "Datasets" ], "description": "Fetch the events in a dataset. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint.", "summary": "Fetch dataset (POST form)", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" } ], "requestBody": { "description": "Filters for the fetch query", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FetchEventsRequest" } } } }, "responses": { "200": { "description": "Returns the fetched rows", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FetchDatasetEventsResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getDatasetIdFetch", "tags": [ "Datasets" ], "description": "Fetch the events in a dataset. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint.", "summary": "Fetch dataset (GET form)", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" }, { "$ref": "#/components/parameters/FetchLimitParam" }, { "$ref": "#/components/parameters/MaxXactId" }, { "$ref": "#/components/parameters/MaxRootSpanId" }, { "$ref": "#/components/parameters/Version" } ], "responses": { "200": { "description": "Returns the fetched rows", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FetchDatasetEventsResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsDatasetIdFetch", "description": "Enable CORS", "summary": "Enable CORS (`/v1/dataset/{dataset_id}/fetch`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/dataset/{dataset_id}/feedback": { "post": { "operationId": "postDatasetIdFeedback", "tags": [ "Datasets" ], "description": "Log feedback for a set of dataset events", "summary": "Feedback for dataset events", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" } ], "requestBody": { "description": "An array of feedback objects", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackDatasetEventRequest" } } } }, "responses": { "200": { "description": "Returns a success status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackResponseSchema" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsDatasetIdFeedback", "description": "Enable CORS", "summary": "Enable CORS (`/v1/dataset/{dataset_id}/feedback`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/dataset/{dataset_id}/summarize": { "get": { "operationId": "getDatasetIdSummarize", "tags": [ "Datasets" ], "description": "Summarize dataset", "summary": "Summarize dataset", "security": [ { "bearerAuth": [] } ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" }, { "$ref": "#/components/parameters/SummarizeData" } ], "responses": { "200": { "description": "Dataset summary", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SummarizeDatasetResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsDatasetIdSummarize", "description": "Enable CORS", "summary": "Enable CORS (`/v1/dataset/{dataset_id}/summarize`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/DatasetIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/prompt": { "post": { "tags": [ "Prompts" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postPrompt", "description": "Create a new prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will return the existing prompt unmodified", "summary": "Create prompt", "requestBody": { "description": "Any desired information about the new prompt object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePrompt" } } } }, "responses": { "200": { "description": "Returns the new prompt object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "Prompts" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putPrompt", "description": "Create or replace prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will replace the existing prompt with the provided fields", "summary": "Create or replace prompt", "requestBody": { "description": "Any desired information about the new prompt object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePrompt" } } } }, "responses": { "200": { "description": "Returns the new prompt object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getPrompt", "tags": [ "Prompts" ], "description": "List out all prompts. The prompts are sorted by creation date, with the most recently-created prompts coming first", "summary": "List prompts", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/PromptName" }, { "$ref": "#/components/parameters/ProjectName" }, { "$ref": "#/components/parameters/ProjectIdQuery" }, { "$ref": "#/components/parameters/Slug" }, { "$ref": "#/components/parameters/PromptVersion" }, { "$ref": "#/components/parameters/PromptEnvironment" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of prompt objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" }, "description": "A list of prompt objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsPrompt", "description": "Enable CORS", "summary": "Enable CORS (`/v1/prompt`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/prompt/{prompt_id}": { "get": { "operationId": "getPromptId", "tags": [ "Prompts" ], "description": "Get a prompt object by its id", "summary": "Get prompt", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/PromptIdParam" }, { "$ref": "#/components/parameters/PromptVersion" }, { "$ref": "#/components/parameters/PromptEnvironment" } ], "responses": { "200": { "description": "Returns the prompt object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchPromptId", "tags": [ "Prompts" ], "description": "Partially update a prompt object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update prompt", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/PromptIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchPrompt" } } } }, "responses": { "200": { "description": "Returns the prompt object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deletePromptId", "tags": [ "Prompts" ], "description": "Delete a prompt object by its id", "summary": "Delete prompt", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/PromptIdParam" } ], "responses": { "200": { "description": "Returns the deleted prompt object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsPromptId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/prompt/{prompt_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/PromptIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/role": { "post": { "tags": [ "Roles" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postRole", "description": "Create a new role. If there is an existing role with the same name as the one specified in the request, will return the existing role unmodified", "summary": "Create role", "requestBody": { "description": "Any desired information about the new role object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRole" } } } }, "responses": { "200": { "description": "Returns the new role object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Role" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "Roles" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putRole", "description": "Create or replace role. If there is an existing role with the same name as the one specified in the request, will replace the existing role with the provided fields", "summary": "Create or replace role", "requestBody": { "description": "Any desired information about the new role object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRole" } } } }, "responses": { "200": { "description": "Returns the new role object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Role" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getRole", "tags": [ "Roles" ], "description": "List out all roles. The roles are sorted by creation date, with the most recently-created roles coming first", "summary": "List roles", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/RoleName" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of role objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/Role" }, "description": "A list of role objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsRole", "description": "Enable CORS", "summary": "Enable CORS (`/v1/role`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/role/{role_id}": { "get": { "operationId": "getRoleId", "tags": [ "Roles" ], "description": "Get a role object by its id", "summary": "Get role", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/RoleIdParam" } ], "responses": { "200": { "description": "Returns the role object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Role" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchRoleId", "tags": [ "Roles" ], "description": "Partially update a role object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update role", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/RoleIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchRole" } } } }, "responses": { "200": { "description": "Returns the role object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Role" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteRoleId", "tags": [ "Roles" ], "description": "Delete a role object by its id", "summary": "Delete role", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/RoleIdParam" } ], "responses": { "200": { "description": "Returns the deleted role object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Role" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsRoleId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/role/{role_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/RoleIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/group": { "post": { "tags": [ "Groups" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postGroup", "description": "Create a new group. If there is an existing group with the same name as the one specified in the request, will return the existing group unmodified", "summary": "Create group", "requestBody": { "description": "Any desired information about the new group object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateGroup" } } } }, "responses": { "200": { "description": "Returns the new group object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Group" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "Groups" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putGroup", "description": "Create or replace group. If there is an existing group with the same name as the one specified in the request, will replace the existing group with the provided fields", "summary": "Create or replace group", "requestBody": { "description": "Any desired information about the new group object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateGroup" } } } }, "responses": { "200": { "description": "Returns the new group object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Group" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getGroup", "tags": [ "Groups" ], "description": "List out all groups. The groups are sorted by creation date, with the most recently-created groups coming first", "summary": "List groups", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/GroupName" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of group objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/Group" }, "description": "A list of group objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsGroup", "description": "Enable CORS", "summary": "Enable CORS (`/v1/group`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/group/{group_id}": { "get": { "operationId": "getGroupId", "tags": [ "Groups" ], "description": "Get a group object by its id", "summary": "Get group", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/GroupIdParam" } ], "responses": { "200": { "description": "Returns the group object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Group" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchGroupId", "tags": [ "Groups" ], "description": "Partially update a group object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update group", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/GroupIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchGroup" } } } }, "responses": { "200": { "description": "Returns the group object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Group" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteGroupId", "tags": [ "Groups" ], "description": "Delete a group object by its id", "summary": "Delete group", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/GroupIdParam" } ], "responses": { "200": { "description": "Returns the deleted group object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Group" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsGroupId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/group/{group_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/GroupIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/acl": { "post": { "tags": [ "Acls" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postAcl", "description": "Create a new acl. If there is an existing acl with the same contents as the one specified in the request, will return the existing acl unmodified", "summary": "Create acl", "requestBody": { "description": "Any desired information about the new acl object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AclItem" } } } }, "responses": { "200": { "description": "Returns the new acl object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Acl" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteAcl", "tags": [ "Acls" ], "description": "Delete a single acl", "summary": "Delete single acl", "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "Parameters which uniquely specify the acl to delete", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AclItem" } } } }, "responses": { "200": { "description": "Returns the deleted acl object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Acl" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getAcl", "tags": [ "Acls" ], "description": "List out all acls. The acls are sorted by creation date, with the most recently-created acls coming first", "summary": "List acls", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/AclObjectType" }, { "$ref": "#/components/parameters/AclObjectId" }, { "$ref": "#/components/parameters/AclListUserId" }, { "$ref": "#/components/parameters/AclListGroupId" }, { "$ref": "#/components/parameters/AclListPermission" }, { "$ref": "#/components/parameters/AclListRestrictObjectType" }, { "$ref": "#/components/parameters/AclListRoleId" } ], "responses": { "200": { "description": "Returns a list of acl objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/Acl" }, "description": "A list of acl objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsAcl", "description": "Enable CORS", "summary": "Enable CORS (`/v1/acl`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/acl/{acl_id}": { "get": { "operationId": "getAclId", "tags": [ "Acls" ], "description": "Get an acl object by its id", "summary": "Get acl", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AclIdParam" } ], "responses": { "200": { "description": "Returns the acl object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Acl" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteAclId", "tags": [ "Acls" ], "description": "Delete an acl object by its id", "summary": "Delete acl", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AclIdParam" } ], "responses": { "200": { "description": "Returns the deleted acl object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Acl" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsAclId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/acl/{acl_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/AclIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/acl/batch_update": { "post": { "operationId": "aclBatchUpdate", "tags": [ "Acls" ], "description": "Batch update acls. This operation is idempotent, so adding acls which already exist will have no effect, and removing acls which do not exist will have no effect.", "summary": "Batch update acls", "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "Acls to add/remove.", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AclBatchUpdateRequest" } } } }, "responses": { "200": { "description": "A success status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AclBatchUpdateResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/acl/list_org": { "get": { "operationId": "aclListOrg", "tags": [ "Acls" ], "description": "List all acls in the org. This query requires the caller to have `read_acls` permission at the organization level", "summary": "List org acls", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/AclListOrgObjectType" }, { "$ref": "#/components/parameters/AclListOrgObjectId" }, { "$ref": "#/components/parameters/AclListUserId" }, { "$ref": "#/components/parameters/AclListGroupId" }, { "$ref": "#/components/parameters/AclListPermission" }, { "$ref": "#/components/parameters/AclListRestrictObjectType" }, { "$ref": "#/components/parameters/AclListRoleId" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "A list of acls", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Acl" } } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsAclListOrg", "description": "Enable CORS", "summary": "Enable CORS (`/v1/acl/list_org`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/acl/acl/batch_update": { "options": { "operationId": "optionsAclBatchUpdate", "description": "Enable CORS", "summary": "Enable CORS (`/v1/acl/acl/batch_update`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/user": { "get": { "operationId": "getUser", "tags": [ "Users" ], "description": "List out all users. The users are sorted by creation date, with the most recently-created users coming first", "summary": "List users", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/UserGivenName" }, { "$ref": "#/components/parameters/UserFamilyName" }, { "$ref": "#/components/parameters/UserEmail" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of user objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/User" }, "description": "A list of user objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsUser", "description": "Enable CORS", "summary": "Enable CORS (`/v1/user`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/user/{user_id}": { "get": { "operationId": "getUserId", "tags": [ "Users" ], "description": "Get a user object by its id", "summary": "Get user", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/UserIdParam" } ], "responses": { "200": { "description": "Returns the user object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsUserId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/user/{user_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/UserIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/project_automation": { "post": { "tags": [ "ProjectAutomations" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postProjectAutomation", "description": "Create a new project_automation. If there is an existing project_automation with the same name as the one specified in the request, will return the existing project_automation unmodified", "summary": "Create project_automation", "requestBody": { "description": "Any desired information about the new project_automation object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateProjectAutomation" } } } }, "responses": { "200": { "description": "Returns the new project_automation object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectAutomation" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "ProjectAutomations" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putProjectAutomation", "description": "Create or replace project_automation. If there is an existing project_automation with the same name as the one specified in the request, will replace the existing project_automation with the provided fields", "summary": "Create or replace project_automation", "requestBody": { "description": "Any desired information about the new project_automation object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateProjectAutomation" } } } }, "responses": { "200": { "description": "Returns the new project_automation object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectAutomation" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getProjectAutomation", "tags": [ "ProjectAutomations" ], "description": "List out all project_automations. The project_automations are sorted by creation date, with the most recently-created project_automations coming first", "summary": "List project_automations", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/ProjectAutomationName" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of project_automation objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/ProjectAutomation" }, "description": "A list of project_automation objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProjectAutomation", "description": "Enable CORS", "summary": "Enable CORS (`/v1/project_automation`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/project_automation/{project_automation_id}": { "get": { "operationId": "getProjectAutomationId", "tags": [ "ProjectAutomations" ], "description": "Get a project_automation object by its id", "summary": "Get project_automation", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectAutomationIdParam" } ], "responses": { "200": { "description": "Returns the project_automation object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectAutomation" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchProjectAutomationId", "tags": [ "ProjectAutomations" ], "description": "Partially update a project_automation object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update project_automation", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectAutomationIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchProjectAutomation" } } } }, "responses": { "200": { "description": "Returns the project_automation object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectAutomation" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteProjectAutomationId", "tags": [ "ProjectAutomations" ], "description": "Delete a project_automation object by its id", "summary": "Delete project_automation", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectAutomationIdParam" } ], "responses": { "200": { "description": "Returns the deleted project_automation object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectAutomation" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProjectAutomationId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/project_automation/{project_automation_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ProjectAutomationIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/project_score": { "post": { "tags": [ "ProjectScores" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postProjectScore", "description": "Create a new project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will return the existing project_score unmodified", "summary": "Create project_score", "requestBody": { "description": "Any desired information about the new project_score object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateProjectScore" } } } }, "responses": { "200": { "description": "Returns the new project_score object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectScore" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "ProjectScores" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putProjectScore", "description": "Create or replace project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will replace the existing project_score with the provided fields", "summary": "Create or replace project_score", "requestBody": { "description": "Any desired information about the new project_score object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateProjectScore" } } } }, "responses": { "200": { "description": "Returns the new project_score object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectScore" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getProjectScore", "tags": [ "ProjectScores" ], "description": "List out all project_scores. The project_scores are sorted by creation date, with the most recently-created project_scores coming first", "summary": "List project_scores", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/ProjectScoreName" }, { "$ref": "#/components/parameters/ProjectName" }, { "$ref": "#/components/parameters/ProjectIdQuery" }, { "$ref": "#/components/parameters/OrgName" }, { "$ref": "#/components/parameters/ProjectScoreType" } ], "responses": { "200": { "description": "Returns a list of project_score objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/ProjectScore" }, "description": "A list of project_score objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProjectScore", "description": "Enable CORS", "summary": "Enable CORS (`/v1/project_score`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/project_score/{project_score_id}": { "get": { "operationId": "getProjectScoreId", "tags": [ "ProjectScores" ], "description": "Get a project_score object by its id", "summary": "Get project_score", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectScoreIdParam" } ], "responses": { "200": { "description": "Returns the project_score object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectScore" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchProjectScoreId", "tags": [ "ProjectScores" ], "description": "Partially update a project_score object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update project_score", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectScoreIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchProjectScore" } } } }, "responses": { "200": { "description": "Returns the project_score object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectScore" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteProjectScoreId", "tags": [ "ProjectScores" ], "description": "Delete a project_score object by its id", "summary": "Delete project_score", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectScoreIdParam" } ], "responses": { "200": { "description": "Returns the deleted project_score object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectScore" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProjectScoreId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/project_score/{project_score_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ProjectScoreIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/project_tag": { "post": { "tags": [ "ProjectTags" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postProjectTag", "description": "Create a new project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will return the existing project_tag unmodified", "summary": "Create project_tag", "requestBody": { "description": "Any desired information about the new project_tag object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateProjectTag" } } } }, "responses": { "200": { "description": "Returns the new project_tag object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectTag" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "ProjectTags" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putProjectTag", "description": "Create or replace project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will replace the existing project_tag with the provided fields", "summary": "Create or replace project_tag", "requestBody": { "description": "Any desired information about the new project_tag object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateProjectTag" } } } }, "responses": { "200": { "description": "Returns the new project_tag object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectTag" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getProjectTag", "tags": [ "ProjectTags" ], "description": "List out all project_tags. The project_tags are sorted by creation date, with the most recently-created project_tags coming first", "summary": "List project_tags", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/ProjectTagName" }, { "$ref": "#/components/parameters/ProjectName" }, { "$ref": "#/components/parameters/ProjectIdQuery" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of project_tag objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/ProjectTag" }, "description": "A list of project_tag objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProjectTag", "description": "Enable CORS", "summary": "Enable CORS (`/v1/project_tag`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/project_tag/{project_tag_id}": { "get": { "operationId": "getProjectTagId", "tags": [ "ProjectTags" ], "description": "Get a project_tag object by its id", "summary": "Get project_tag", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectTagIdParam" } ], "responses": { "200": { "description": "Returns the project_tag object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectTag" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchProjectTagId", "tags": [ "ProjectTags" ], "description": "Partially update a project_tag object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update project_tag", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectTagIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchProjectTag" } } } }, "responses": { "200": { "description": "Returns the project_tag object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectTag" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteProjectTagId", "tags": [ "ProjectTags" ], "description": "Delete a project_tag object by its id", "summary": "Delete project_tag", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ProjectTagIdParam" } ], "responses": { "200": { "description": "Returns the deleted project_tag object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectTag" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProjectTagId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/project_tag/{project_tag_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ProjectTagIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/span_iframe": { "post": { "tags": [ "SpanIframes" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postSpanIframe", "description": "Create a new span_iframe. If there is an existing span_iframe with the same name as the one specified in the request, will return the existing span_iframe unmodified", "summary": "Create span_iframe", "requestBody": { "description": "Any desired information about the new span_iframe object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSpanIFrame" } } } }, "responses": { "200": { "description": "Returns the new span_iframe object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpanIFrame" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "SpanIframes" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putSpanIframe", "description": "Create or replace span_iframe. If there is an existing span_iframe with the same name as the one specified in the request, will replace the existing span_iframe with the provided fields", "summary": "Create or replace span_iframe", "requestBody": { "description": "Any desired information about the new span_iframe object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSpanIFrame" } } } }, "responses": { "200": { "description": "Returns the new span_iframe object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpanIFrame" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getSpanIframe", "tags": [ "SpanIframes" ], "description": "List out all span_iframes. The span_iframes are sorted by creation date, with the most recently-created span_iframes coming first", "summary": "List span_iframes", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/SpanIframeName" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of span_iframe objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/SpanIFrame" }, "description": "A list of span_iframe objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsSpanIframe", "description": "Enable CORS", "summary": "Enable CORS (`/v1/span_iframe`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/span_iframe/{span_iframe_id}": { "get": { "operationId": "getSpanIframeId", "tags": [ "SpanIframes" ], "description": "Get a span_iframe object by its id", "summary": "Get span_iframe", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/SpanIframeIdParam" } ], "responses": { "200": { "description": "Returns the span_iframe object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpanIFrame" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchSpanIframeId", "tags": [ "SpanIframes" ], "description": "Partially update a span_iframe object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update span_iframe", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/SpanIframeIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchSpanIFrame" } } } }, "responses": { "200": { "description": "Returns the span_iframe object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpanIFrame" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteSpanIframeId", "tags": [ "SpanIframes" ], "description": "Delete a span_iframe object by its id", "summary": "Delete span_iframe", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/SpanIframeIdParam" } ], "responses": { "200": { "description": "Returns the deleted span_iframe object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpanIFrame" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsSpanIframeId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/span_iframe/{span_iframe_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/SpanIframeIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/function": { "post": { "tags": [ "Functions" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postFunction", "description": "Create a new function. If there is an existing function in the project with the same slug as the one specified in the request, will return the existing function unmodified", "summary": "Create function", "requestBody": { "description": "Any desired information about the new function object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateFunction" } } } }, "responses": { "200": { "description": "Returns the new function object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Function" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "Functions" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putFunction", "description": "Create or replace function. If there is an existing function in the project with the same slug as the one specified in the request, will replace the existing function with the provided fields", "summary": "Create or replace function", "requestBody": { "description": "Any desired information about the new function object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateFunction" } } } }, "responses": { "200": { "description": "Returns the new function object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Function" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getFunction", "tags": [ "Functions" ], "description": "List out all functions. The functions are sorted by creation date, with the most recently-created functions coming first", "summary": "List functions", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/FunctionName" }, { "$ref": "#/components/parameters/ProjectName" }, { "$ref": "#/components/parameters/ProjectIdQuery" }, { "$ref": "#/components/parameters/Slug" }, { "$ref": "#/components/parameters/PromptVersion" }, { "$ref": "#/components/parameters/PromptEnvironment" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of function objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/Function" }, "description": "A list of function objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsFunction", "description": "Enable CORS", "summary": "Enable CORS (`/v1/function`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/function/{function_id}": { "get": { "operationId": "getFunctionId", "tags": [ "Functions" ], "description": "Get a function object by its id", "summary": "Get function", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/FunctionIdParam" }, { "$ref": "#/components/parameters/PromptVersion" }, { "$ref": "#/components/parameters/PromptEnvironment" } ], "responses": { "200": { "description": "Returns the function object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Function" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchFunctionId", "tags": [ "Functions" ], "description": "Partially update a function object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update function", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/FunctionIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchFunction" } } } }, "responses": { "200": { "description": "Returns the function object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Function" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteFunctionId", "tags": [ "Functions" ], "description": "Delete a function object by its id", "summary": "Delete function", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/FunctionIdParam" } ], "responses": { "200": { "description": "Returns the deleted function object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Function" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsFunctionId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/function/{function_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/FunctionIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/function/{function_id}/invoke": { "post": { "operationId": "postFunctionIdInvoke", "tags": [ "Functions" ], "description": "Invoke a function.", "summary": "Invoke function", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/FunctionIdParam" } ], "requestBody": { "description": "Function invocation parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvokeApi" } } } }, "responses": { "200": { "description": "Function invocation response", "content": { "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsFunctionIdInvoke", "description": "Enable CORS", "summary": "Enable CORS (`/v1/function/{function_id}/invoke`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/FunctionIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/view": { "post": { "tags": [ "Views" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postView", "description": "Create a new view. If there is an existing view with the same name as the one specified in the request, will return the existing view unmodified", "summary": "Create view", "requestBody": { "description": "Any desired information about the new view object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateView" } } } }, "responses": { "200": { "description": "Returns the new view object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/View" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "Views" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putView", "description": "Create or replace view. If there is an existing view with the same name as the one specified in the request, will replace the existing view with the provided fields", "summary": "Create or replace view", "requestBody": { "description": "Any desired information about the new view object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateView" } } } }, "responses": { "200": { "description": "Returns the new view object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/View" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getView", "tags": [ "Views" ], "description": "List out all views. The views are sorted by creation date, with the most recently-created views coming first", "summary": "List views", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/ViewName" }, { "$ref": "#/components/parameters/ViewType" }, { "$ref": "#/components/parameters/AclObjectType" }, { "$ref": "#/components/parameters/AclObjectId" } ], "responses": { "200": { "description": "Returns a list of view objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/View" }, "description": "A list of view objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsView", "description": "Enable CORS", "summary": "Enable CORS (`/v1/view`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/view/{view_id}": { "get": { "operationId": "getViewId", "tags": [ "Views" ], "description": "Get a view object by its id", "summary": "Get view", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ViewIdParam" }, { "$ref": "#/components/parameters/AclObjectType" }, { "$ref": "#/components/parameters/AclObjectId" } ], "responses": { "200": { "description": "Returns the view object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/View" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchViewId", "tags": [ "Views" ], "description": "Partially update a view object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update view", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ViewIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchView" } } } }, "responses": { "200": { "description": "Returns the view object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/View" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteViewId", "tags": [ "Views" ], "description": "Delete a view object by its id", "summary": "Delete view", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ViewIdParam" } ], "requestBody": { "description": "Additional parameters for the delete operation", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteView" } } } }, "responses": { "200": { "description": "Returns the deleted view object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/View" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsViewId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/view/{view_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ViewIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/organization": { "get": { "operationId": "getOrganization", "tags": [ "Organizations" ], "description": "List out all organizations. The organizations are sorted by creation date, with the most recently-created organizations coming first", "summary": "List organizations", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of organization objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/Organization" }, "description": "A list of organization objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsOrganization", "description": "Enable CORS", "summary": "Enable CORS (`/v1/organization`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/organization/{organization_id}": { "get": { "operationId": "getOrganizationId", "tags": [ "Organizations" ], "description": "Get an organization object by its id", "summary": "Get organization", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/OrganizationIdParam" } ], "responses": { "200": { "description": "Returns the organization object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Organization" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchOrganizationId", "tags": [ "Organizations" ], "description": "Partially update an organization object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update organization", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/OrganizationIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchOrganization" } } } }, "responses": { "200": { "description": "Returns the organization object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Organization" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsOrganizationId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/organization/{organization_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/OrganizationIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/organization/members": { "patch": { "operationId": "patchOrganizationMembers", "tags": [ "Organizations" ], "description": "Modify organization membership.\n\nOrganization owners can use this endpoint to create service accounts, but service tokens for those accounts must be created in the Braintrust UI, at [**Settings > Service tokens**](https://www.braintrust.dev/app/~/configuration/org/service-tokens).", "summary": "Modify organization membership", "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "Members to add/remove", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchOrganizationMembers" } } } }, "responses": { "200": { "description": "A success status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchOrganizationMembersOutput" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsOrganizationMembers", "description": "Enable CORS", "summary": "Enable CORS (`/v1/organization/members`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/api_key": { "get": { "operationId": "getApiKey", "tags": [ "ApiKeys" ], "description": "List out all API keys. They are sorted by creation date, with the most recently-created keys coming first.\n\nTo create new API keys, go to [**Settings > API keys**](https://www.braintrust.dev/app/~/configuration/org/api-keys) in the Braintrust UI.", "summary": "List api_keys", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/ApiKeyName" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of api_key objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/ApiKey" }, "description": "A list of api_key objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsApiKey", "description": "Enable CORS", "summary": "Enable CORS (`/v1/api_key`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/api_key/{api_key_id}": { "get": { "operationId": "getApiKeyId", "tags": [ "ApiKeys" ], "description": "Get an api_key object by its id", "summary": "Get api_key", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ApiKeyIdParam" } ], "responses": { "200": { "description": "Returns the api_key object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiKey" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteApiKeyId", "tags": [ "ApiKeys" ], "description": "Delete an api_key object by its id", "summary": "Delete api_key", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ApiKeyIdParam" } ], "responses": { "200": { "description": "Returns the deleted api_key object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiKey" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsApiKeyId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/api_key/{api_key_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ApiKeyIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/service_token": { "delete": { "operationId": "deleteServiceToken", "tags": [ "ServiceTokens" ], "description": "Delete a single service_token", "summary": "Delete single service_token", "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "Parameters which uniquely specify the service_token to delete", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteServiceToken" } } } }, "responses": { "200": { "description": "Returns the deleted service_token object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceToken" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getServiceToken", "tags": [ "ServiceTokens" ], "description": "List out all service tokens. They are sorted by creation date, with the most recently-created tokens coming first.\n\nTo create service tokens, organization owners can go to [**Settings > Service tokens**](https://www.braintrust.dev/app/~/configuration/org/service-tokens) in the Braintrust UI.", "summary": "List service_tokens", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/ServiceTokenName" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of service_token objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/ServiceToken" }, "description": "A list of service_token objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsServiceToken", "description": "Enable CORS", "summary": "Enable CORS (`/v1/service_token`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/service_token/{service_token_id}": { "get": { "operationId": "getServiceTokenId", "tags": [ "ServiceTokens" ], "description": "Get a service_token object by its id", "summary": "Get service_token", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ServiceTokenIdParam" } ], "responses": { "200": { "description": "Returns the service_token object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceToken" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteServiceTokenId", "tags": [ "ServiceTokens" ], "description": "Delete a service_token object by its id", "summary": "Delete service_token", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/ServiceTokenIdParam" } ], "responses": { "200": { "description": "Returns the deleted service_token object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ServiceToken" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsServiceTokenId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/service_token/{service_token_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/ServiceTokenIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/ai_secret": { "post": { "tags": [ "AiSecrets" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postAiSecret", "description": "Create a new ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will return the existing ai_secret unmodified", "summary": "Create ai_secret", "requestBody": { "description": "Any desired information about the new ai_secret object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAISecret" } } } }, "responses": { "200": { "description": "Returns the new ai_secret object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AISecret" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "AiSecrets" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putAiSecret", "description": "Create or replace ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will replace the existing ai_secret with the provided fields", "summary": "Create or replace ai_secret", "requestBody": { "description": "Any desired information about the new ai_secret object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAISecret" } } } }, "responses": { "200": { "description": "Returns the new ai_secret object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AISecret" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteAiSecret", "tags": [ "AiSecrets" ], "description": "Delete a single ai_secret", "summary": "Delete single ai_secret", "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "Parameters which uniquely specify the ai_secret to delete", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteAISecret" } } } }, "responses": { "200": { "description": "Returns the deleted ai_secret object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AISecret" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getAiSecret", "tags": [ "AiSecrets" ], "description": "List out all ai_secrets. The ai_secrets are sorted by creation date, with the most recently-created ai_secrets coming first", "summary": "List ai_secrets", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/AiSecretName" }, { "$ref": "#/components/parameters/OrgName" }, { "$ref": "#/components/parameters/AISecretType" } ], "responses": { "200": { "description": "Returns a list of ai_secret objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/AISecret" }, "description": "A list of ai_secret objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsAiSecret", "description": "Enable CORS", "summary": "Enable CORS (`/v1/ai_secret`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/ai_secret/{ai_secret_id}": { "get": { "operationId": "getAiSecretId", "tags": [ "AiSecrets" ], "description": "Get an ai_secret object by its id", "summary": "Get ai_secret", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AiSecretIdParam" } ], "responses": { "200": { "description": "Returns the ai_secret object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AISecret" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchAiSecretId", "tags": [ "AiSecrets" ], "description": "Partially update an ai_secret object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update ai_secret", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AiSecretIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchAISecret" } } } }, "responses": { "200": { "description": "Returns the ai_secret object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AISecret" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteAiSecretId", "tags": [ "AiSecrets" ], "description": "Delete an ai_secret object by its id", "summary": "Delete ai_secret", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AiSecretIdParam" } ], "responses": { "200": { "description": "Returns the deleted ai_secret object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AISecret" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsAiSecretId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/ai_secret/{ai_secret_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/AiSecretIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/env_var": { "post": { "tags": [ "EnvVars" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postEnvVar", "description": "Create a new env_var. If there is an existing env_var with the same name as the one specified in the request, will return the existing env_var unmodified", "summary": "Create env_var", "requestBody": { "description": "Any desired information about the new env_var object", "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "object_type": { "type": "string", "enum": [ "organization", "project", "function" ], "description": "The type of the object the environment variable is scoped for" }, "object_id": { "type": "string", "format": "uuid", "description": "The id of the object the environment variable is scoped for" }, "name": { "type": "string", "description": "The name of the environment variable" }, "value": { "type": "string", "nullable": true, "description": "The value of the environment variable. Will be encrypted at rest." }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Optional metadata associated with the environment variable when managed via the function secrets API" }, "secret_type": { "type": "string", "nullable": true, "description": "Optional classification for the secret (for example, the AI provider name)" } }, "required": [ "object_type", "object_id", "name" ] } } } }, "responses": { "200": { "description": "Returns the new env_var object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EnvVar" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "EnvVars" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putEnvVar", "description": "Create or replace env_var. If there is an existing env_var with the same name as the one specified in the request, will replace the existing env_var with the provided fields", "summary": "Create or replace env_var", "requestBody": { "description": "Any desired information about the new env_var object", "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "object_type": { "type": "string", "enum": [ "organization", "project", "function" ], "description": "The type of the object the environment variable is scoped for" }, "object_id": { "type": "string", "format": "uuid", "description": "The id of the object the environment variable is scoped for" }, "name": { "type": "string", "description": "The name of the environment variable" }, "value": { "type": "string", "nullable": true, "description": "The value of the environment variable. Will be encrypted at rest." }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Optional metadata associated with the environment variable when managed via the function secrets API" }, "secret_type": { "type": "string", "nullable": true, "description": "Optional classification for the secret (for example, the AI provider name)" } }, "required": [ "object_type", "object_id", "name" ] } } } }, "responses": { "200": { "description": "Returns the new env_var object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EnvVar" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getEnvVar", "tags": [ "EnvVars" ], "description": "List out all env_vars. The env_vars are sorted by creation date, with the most recently-created env_vars coming first", "summary": "List env_vars", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/EnvVarName" }, { "$ref": "#/components/parameters/EnvVarObjectType" }, { "$ref": "#/components/parameters/EnvVarObjectId" } ], "responses": { "200": { "description": "Returns a list of env_var objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/EnvVar" }, "description": "A list of env_var objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsEnvVar", "description": "Enable CORS", "summary": "Enable CORS (`/v1/env_var`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/env_var/{env_var_id}": { "get": { "operationId": "getEnvVarId", "tags": [ "EnvVars" ], "description": "Get an env_var object by its id", "summary": "Get env_var", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/EnvVarIdParam" } ], "responses": { "200": { "description": "Returns the env_var object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EnvVar" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchEnvVarId", "tags": [ "EnvVars" ], "description": "Partially update an env_var object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update env_var", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/EnvVarIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the environment variable" }, "value": { "type": "string", "nullable": true, "description": "The value of the environment variable. Will be encrypted at rest." }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true }, "description": "Optional metadata associated with the environment variable when managed via the function secrets API" }, "secret_type": { "type": "string", "nullable": true, "description": "Optional classification for the secret (for example, the AI provider name)" } }, "required": [ "name" ] } } } }, "responses": { "200": { "description": "Returns the env_var object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EnvVar" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteEnvVarId", "tags": [ "EnvVars" ], "description": "Delete an env_var object by its id", "summary": "Delete env_var", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/EnvVarIdParam" } ], "responses": { "200": { "description": "Returns the deleted env_var object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EnvVar" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsEnvVarId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/env_var/{env_var_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/EnvVarIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/mcp_server": { "post": { "tags": [ "McpServers" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postMcpServer", "description": "Create a new mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will return the existing mcp_server unmodified", "summary": "Create mcp_server", "requestBody": { "description": "Any desired information about the new mcp_server object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateMCPServer" } } } }, "responses": { "200": { "description": "Returns the new mcp_server object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MCPServer" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "McpServers" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putMcpServer", "description": "Create or replace mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will replace the existing mcp_server with the provided fields", "summary": "Create or replace mcp_server", "requestBody": { "description": "Any desired information about the new mcp_server object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateMCPServer" } } } }, "responses": { "200": { "description": "Returns the new mcp_server object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MCPServer" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getMcpServer", "tags": [ "McpServers" ], "description": "List out all mcp_servers. The mcp_servers are sorted by creation date, with the most recently-created mcp_servers coming first", "summary": "List mcp_servers", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/McpServerName" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of mcp_server objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/MCPServer" }, "description": "A list of mcp_server objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsMcpServer", "description": "Enable CORS", "summary": "Enable CORS (`/v1/mcp_server`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/mcp_server/{mcp_server_id}": { "get": { "operationId": "getMcpServerId", "tags": [ "McpServers" ], "description": "Get a mcp_server object by its id", "summary": "Get mcp_server", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/McpServerIdParam" } ], "responses": { "200": { "description": "Returns the mcp_server object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MCPServer" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchMcpServerId", "tags": [ "McpServers" ], "description": "Partially update a mcp_server object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update mcp_server", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/McpServerIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchMCPServer" } } } }, "responses": { "200": { "description": "Returns the mcp_server object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MCPServer" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteMcpServerId", "tags": [ "McpServers" ], "description": "Delete a mcp_server object by its id", "summary": "Delete mcp_server", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/McpServerIdParam" } ], "responses": { "200": { "description": "Returns the deleted mcp_server object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MCPServer" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsMcpServerId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/mcp_server/{mcp_server_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/McpServerIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/dataset_snapshot": { "post": { "tags": [ "DatasetSnapshots" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "postDatasetSnapshot", "description": "Create a new dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will return the existing dataset_snapshot unmodified", "summary": "Create dataset_snapshot", "requestBody": { "description": "Any desired information about the new dataset_snapshot object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateDatasetSnapshot" } } } }, "responses": { "200": { "description": "Returns the new dataset_snapshot object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatasetSnapshot" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "put": { "tags": [ "DatasetSnapshots" ], "security": [ { "bearerAuth": [] }, {} ], "operationId": "putDatasetSnapshot", "description": "Create or replace dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will replace the existing dataset_snapshot with the provided fields", "summary": "Create or replace dataset_snapshot", "requestBody": { "description": "Any desired information about the new dataset_snapshot object", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateDatasetSnapshot" } } } }, "responses": { "200": { "description": "Returns the new dataset_snapshot object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatasetSnapshot" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "get": { "operationId": "getDatasetSnapshot", "tags": [ "DatasetSnapshots" ], "description": "List out all dataset_snapshots. The dataset_snapshots are sorted by creation date, with the most recently-created dataset_snapshots coming first", "summary": "List dataset_snapshots", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/AppLimitParam" }, { "$ref": "#/components/parameters/StartingAfter" }, { "$ref": "#/components/parameters/EndingBefore" }, { "$ref": "#/components/parameters/Ids" }, { "$ref": "#/components/parameters/DatasetSnapshotName" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "Returns a list of dataset_snapshot objects", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/DatasetSnapshot" }, "description": "A list of dataset_snapshot objects" } }, "required": [ "objects" ], "additionalProperties": false } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsDatasetSnapshot", "description": "Enable CORS", "summary": "Enable CORS (`/v1/dataset_snapshot`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/dataset_snapshot/{dataset_snapshot_id}": { "get": { "operationId": "getDatasetSnapshotId", "tags": [ "DatasetSnapshots" ], "description": "Get a dataset_snapshot object by its id", "summary": "Get dataset_snapshot", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/DatasetSnapshotIdParam" } ], "responses": { "200": { "description": "Returns the dataset_snapshot object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatasetSnapshot" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "patchDatasetSnapshotId", "tags": [ "DatasetSnapshots" ], "description": "Partially update a dataset_snapshot object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", "summary": "Partially update dataset_snapshot", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/DatasetSnapshotIdParam" } ], "requestBody": { "description": "Fields to update", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchDatasetSnapshot" } } } }, "responses": { "200": { "description": "Returns the dataset_snapshot object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatasetSnapshot" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteDatasetSnapshotId", "tags": [ "DatasetSnapshots" ], "description": "Delete a dataset_snapshot object by its id", "summary": "Delete dataset_snapshot", "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "$ref": "#/components/parameters/DatasetSnapshotIdParam" } ], "responses": { "200": { "description": "Returns the deleted dataset_snapshot object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatasetSnapshot" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsDatasetSnapshotId", "description": "Enable CORS", "summary": "Enable CORS (`/v1/dataset_snapshot/{dataset_snapshot_id}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "$ref": "#/components/parameters/DatasetSnapshotIdParam" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/environment": { "get": { "operationId": "listEnvironments", "summary": "List environments", "description": "List out all environments. The environments are sorted by creation date, with the most recently-created environments first.", "tags": [ "Environments" ], "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "array", "items": { "type": "string", "format": "uuid" }, "minItems": 1 } ], "description": "Filter by environment IDs. Supports a single ID or multiple values." }, "required": false, "name": "ids", "in": "query" }, { "schema": { "type": "string" }, "required": false, "name": "name", "in": "query" }, { "$ref": "#/components/parameters/OrgName" } ], "responses": { "200": { "description": "List of environments", "content": { "application/json": { "schema": { "type": "object", "properties": { "objects": { "type": "array", "items": { "$ref": "#/components/schemas/Environment" } } }, "required": [ "objects" ] } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "post": { "operationId": "createEnvironment", "summary": "Create environment", "description": "Create a new environment", "tags": [ "Environments" ], "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateEnvironment" } } } }, "responses": { "200": { "description": "Created environment", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Environment" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/environment/{environment_id}": { "get": { "operationId": "getEnvironment", "summary": "Get environment", "tags": [ "Environments" ], "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "schema": { "type": "string", "format": "uuid" }, "required": true, "name": "environment_id", "in": "path" } ], "responses": { "200": { "description": "Environment object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Environment" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "patch": { "operationId": "updateEnvironment", "summary": "Partially update environment", "tags": [ "Environments" ], "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "schema": { "type": "string", "format": "uuid" }, "required": true, "name": "environment_id", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchEnvironment" } } } }, "responses": { "200": { "description": "Updated environment", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Environment" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "delete": { "operationId": "deleteEnvironment", "summary": "Delete environment", "tags": [ "Environments" ], "security": [ { "bearerAuth": [] }, {} ], "parameters": [ { "schema": { "type": "string", "format": "uuid" }, "required": true, "name": "environment_id", "in": "path" } ], "responses": { "200": { "description": "Deleted environment", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Environment" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1": { "get": { "operationId": "getIndex", "tags": [ "Other" ], "description": "Default endpoint. Simply replies with 'Hello, World!'. Authorization is not required", "summary": "Hello world endpoint", "security": [], "responses": { "200": { "description": "Hello world string", "content": { "text/plain": { "schema": { "type": "string" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsIndex", "description": "Enable CORS", "summary": "Enable CORS (`/v1`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/insert": { "post": { "operationId": "postCrossObjectInsert", "tags": [ "CrossObject" ], "description": "Insert events and feedback across object types", "summary": "Cross-object insert", "security": [ { "bearerAuth": [] } ], "requestBody": { "description": "A mapping from event object type -> object id -> events to insert", "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CrossObjectInsertRequest" } } } }, "responses": { "200": { "description": "Returns the inserted row ids for the events on each individual object", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CrossObjectInsertResponse" } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "401": { "description": "No valid API key provided", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "403": { "description": "The API key doesn’t have permissions to perform the request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "429": { "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", "headers": { "Retry-After": { "schema": { "type": "string" } } }, "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } }, "500": { "description": "Something went wrong on Braintrust's end. (These are rare.)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsCrossObjectInsert", "description": "Enable CORS", "summary": "Enable CORS (`/v1/insert`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/proxy/chat/completions": { "post": { "operationId": "proxychatCompletions", "tags": [ "Proxy" ], "description": "Proxy a chat/completions request to the specified model, converting its format as needed. Will cache if temperature=0 or seed is set.", "summary": "Proxy chat/completions", "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "See the [OpenAI docs](https://platform.openai.com/docs/api-reference/chat/create) for details.", "required": true, "content": { "application/json": { "schema": { "nullable": true } } } }, "responses": { "200": { "description": "Proxy response (supports both streaming and non-streaming formats)", "content": { "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProxyproxychatCompletions", "description": "Enable CORS", "summary": "Enable CORS (`/v1/proxy/chat/completions`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/proxy/completions": { "post": { "operationId": "proxycompletions", "tags": [ "Proxy" ], "description": "Proxy a completions request to the specified model, converting its format as needed. Will cache if temperature=0 or seed is set.", "summary": "Proxy completions", "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "See the [OpenAI docs](https://platform.openai.com/docs/api-reference/completions/create) for details.", "required": true, "content": { "application/json": { "schema": { "nullable": true } } } }, "responses": { "200": { "description": "Proxy response (supports both streaming and non-streaming formats)", "content": { "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProxyproxycompletions", "description": "Enable CORS", "summary": "Enable CORS (`/v1/proxy/completions`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/proxy/auto": { "post": { "operationId": "proxyauto", "tags": [ "Proxy" ], "description": "Proxy a request to either chat/completions or completions automatically based on the model. Will cache if temperature=0 or seed is set.", "summary": "Proxy a model to chat/completions or completions automatically", "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "The chat/completions or completions payload (depending on the model)", "required": true, "content": { "application/json": { "schema": { "nullable": true } } } }, "responses": { "200": { "description": "Proxy response (supports both streaming and non-streaming formats)", "content": { "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProxyproxyauto", "description": "Enable CORS", "summary": "Enable CORS (`/v1/proxy/auto`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/proxy/embeddings": { "post": { "operationId": "proxyembeddings", "tags": [ "Proxy" ], "description": "Proxy an embeddings request to the specified model, converting its format as needed. Will cache automatically.", "summary": "Proxy embeddings", "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "See the [OpenAI docs](https://platform.openai.com/docs/api-reference/embeddings/create) for details.", "required": true, "content": { "application/json": { "schema": { "nullable": true } } } }, "responses": { "200": { "description": "Proxy response (supports both streaming and non-streaming formats)", "content": { "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProxyproxyembeddings", "description": "Enable CORS", "summary": "Enable CORS (`/v1/proxy/embeddings`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/proxy/credentials": { "post": { "operationId": "proxycredentials", "tags": [ "Proxy" ], "description": "Create a temporary credential which can access the proxy for a limited time. The temporary credential will be allowed to make requests on behalf of the Braintrust API key (or model provider API key) provided in the `Authorization` header. See [docs](/docs/deploy/ai-proxy#create-temporary-credentials) for code examples.", "summary": "Create temporary credential", "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "The temporary credential will be restricted according to the request body.", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "model": { "type": "string", "nullable": true, "description": "Granted model name. Null/undefined to grant usage of all models." }, "ttl_seconds": { "type": "number", "maximum": 86400, "default": 600, "description": "TTL of the temporary credential. 10 minutes by default." }, "logging": { "type": "object", "nullable": true, "properties": { "project_name": { "type": "string" }, "compress_audio": { "type": "boolean", "default": true } }, "required": [ "project_name" ], "description": "If present, proxy will log requests to the given Braintrust project name." } }, "description": "Payload for requesting temporary credentials." } } } }, "responses": { "200": { "description": "Successfully created temporary credential", "content": { "application/json": { "schema": { "type": "object", "properties": { "key": { "type": "string" } }, "required": [ "key" ] } } } }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } } } } } }, "options": { "operationId": "optionsProxyproxycredentials", "description": "Enable CORS", "summary": "Enable CORS (`/v1/proxy/credentials`)", "security": [], "tags": [ "CORS" ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/proxy/{path+}": { "post": { "operationId": "proxy{path+}", "tags": [ "Proxy" ], "description": "Any requests which do not match the above paths will be proxied directly to the OpenAI API.", "summary": "Proxy any OpenAI request (fallback)", "parameters": [ { "name": "path+", "in": "path", "required": true, "schema": { "type": "array", "items": { "type": "string" } }, "description": "The path to proxy" } ], "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "The request body", "required": true, "content": { "application/json": { "schema": { "nullable": true } } } }, "responses": { "200": { "description": "Proxy response (supports both streaming and non-streaming formats)", "content": { "application/json": { "schema": { "nullable": true } } } } } }, "options": { "operationId": "optionsProxyproxy{path+}", "description": "Enable CORS", "summary": "Enable CORS (`/v1/proxy/{path+}`)", "security": [], "tags": [ "CORS" ], "parameters": [ { "name": "path+", "in": "path", "required": true, "schema": { "type": "array", "items": { "type": "string" } }, "description": "The path to proxy" } ], "responses": { "200": { "description": "Response for CORS method", "headers": { "Access-Control-Allow-Credentials": { "schema": { "type": "string" } }, "Access-Control-Allow-Headers": { "schema": { "type": "string" } }, "Access-Control-Allow-Methods": { "schema": { "type": "string" } }, "Access-Control-Allow-Origin": { "schema": { "type": "string" } }, "Access-Control-Max-Age": { "schema": { "type": "string" } } }, "content": {} }, "400": { "description": "The request was unacceptable, often due to missing a required parameter", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "nullable": true } } } } } } }, "/v1/eval": { "post": { "operationId": "evalLaunch", "tags": [ "Evals" ], "description": "Launch an evaluation. This is the API-equivalent of the `Eval` function that is built into the Braintrust SDK. In the Eval API, you provide pointers to a dataset, task function, and scoring functions. The API will then run the evaluation, create an experiment, and return the results along with a link to the experiment. To learn more about evals, see the [Evals guide](https://www.braintrust.dev/docs/evaluate).", "summary": "Launch an eval", "security": [ { "bearerAuth": [] }, {} ], "requestBody": { "description": "Eval launch parameters", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunEval" } } } }, "responses": { "200": { "description": "Eval launch response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SummarizeExperimentResponse" } } } } } } } } }