{ "openapi": "3.1.0", "info": { "title": "runtime", "description": "The spiced runtime", "license": { "name": "" }, "version": "2.4.0-unstable" }, "servers": [ { "url": "http://localhost:8090", "description": "Local development server. Configure with `--http`." } ], "paths": { "/v1/catalogs": { "get": { "tags": [ "Catalogs" ], "summary": "List Catalogs", "description": "Returns a list of all registered catalogs (data sources). Catalogs provide metadata about schemas and tables available from external data sources.", "operationId": "get_catalogs", "parameters": [ { "name": "from", "in": "query", "description": "Filters catalogs by source (e.g., 'spiceai').", "required": false, "schema": { "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "List of catalogs", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/CatalogInfo" } }, "example": [ { "from": "spiceai", "name": "spiceai" } ] }, "text/csv": { "schema": { "type": "string" }, "example": "\nfrom,name\nspiceai,spiceai\n" } } }, "500": { "description": "Internal server error occurred while processing catalogs", "content": { "application/json": { "schema": {}, "example": { "error": "An unexpected error occurred while processing the catalogs" } } } } } } }, "/v1/chat/completions": { "post": { "tags": [ "AI" ], "summary": "Create Chat Completion", "description": "Creates a model response for the given chat conversation.", "operationId": "post_chat_completions", "requestBody": { "description": "Create a chat completion request using a language model.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateChatCompletionRequest" }, "example": { "model": "gpt-4o", "messages": [ { "role": "developer", "content": "You are a helpful assistant." }, { "role": "user", "content": "Hello!" } ], "stream": false } } }, "required": true }, "responses": { "200": { "description": "Chat completion generated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateChatCompletionResponse" }, "example": { "id": "chatcmpl-123", "object": "chat.completion", "created": 1677652288, "model": "gpt-4o-mini", "system_fingerprint": "fp_44709d6fcb", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "\n\nHello there, how may I assist you today?" }, "logprobs": null, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 9, "completion_tokens": 12, "total_tokens": 21, "completion_tokens_details": { "reasoning_tokens": 0, "accepted_prediction_tokens": 0, "rejected_prediction_tokens": 0 } } } } } }, "400": { "description": "The specified model is an evaluation model; use POST /v1/evaluate" }, "404": { "description": "The specified model was not found" }, "500": { "description": "An internal server error occurred while processing the chat completion", "content": { "application/json": { "schema": {}, "example": { "error": "An internal server error occurred while processing the chat completion." } } } } } } }, "/v1/datasets": { "get": { "tags": [ "Datasets" ], "summary": "List Datasets", "description": "This endpoint returns a list of configured datasets. The response can be formatted as **JSON** or **CSV**,\nand additional filters can be applied using query parameters.\n\nUse `status=true` query parameter to include the current status of each dataset in the response.\nPossible status values: `initializing`, `ready`, `disabled`, `error`, `refreshing`, `shuttingdown`.\nWhen `status=true` and a dataset is in `Error`, the response also includes:\n- `error`: structured code object with `category`, `type`, and stable `code`\n- `error_message`: user-visible details", "operationId": "get_datasets", "parameters": [ { "name": "status", "in": "query", "description": "Whether to include the status field in the response. When `true`, the response includes\nthe current status of each dataset (e.g., `ready`, `initializing`, `refreshing`, `error`).\nDefaults to `false`.", "required": false, "schema": { "type": "boolean" } }, { "name": "format", "in": "query", "description": "The format of the response. Possible values are 'json' (default) or 'csv'.", "required": false, "schema": { "$ref": "#/components/schemas/Format" } }, { "name": "source", "in": "query", "description": "Filters datasets by source (e.g., `postgres:aidemo_messages`).", "required": false, "schema": { "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "List of datasets. When `status=true` is specified, each dataset includes `status` and error metadata (`error`, `error_message`) when applicable.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatasetInfo" }, "example": [ { "from": "postgres:syncs", "name": "daily_journal_accelerated", "replication_enabled": false, "acceleration_enabled": true, "status": "Ready", "error": null, "error_message": null }, { "from": "databricks:hive_metastore.default.messages", "name": "messages_accelerated", "replication_enabled": false, "acceleration_enabled": true, "status": "Error", "error": { "category": "dataset", "type": "auth", "code": "dataset.auth" }, "error_message": "Unable to authenticate with datasource credentials" }, { "from": "postgres:aidemo_messages", "name": "general", "replication_enabled": false, "acceleration_enabled": false, "status": "Initializing", "error": null, "error_message": null } ] }, "text/csv": { "schema": { "type": "string" }, "example": "\nfrom,name,replication_enabled,acceleration_enabled,status,error,error_message\npostgres:syncs,daily_journal_accelerated,false,true,Ready,,\ndatabricks:hive_metastore.default.messages,messages_accelerated,false,true,Error,dataset.auth,Unable to authenticate with datasource credentials\npostgres:aidemo_messages,general,false,false,Initializing,,\n" } } }, "500": { "description": "Internal server error occurred while processing datasets", "content": { "text/plain": { "schema": { "type": "string" }, "example": "An unexpected error occurred while processing datasets" } } } } } }, "/v1/datasets/{name}/acceleration": { "patch": { "tags": [ "Datasets" ], "summary": "Update Refresh SQL", "description": "Update the refresh SQL for a dataset's acceleration.\n\nThis endpoint allows for updating the `refresh_sql` parameter for a dataset's acceleration at runtime.\nThe change is **temporary** and will revert to the `spicepod.yml` definition at the next runtime restart.", "operationId": "patch_dataset_acceleration", "parameters": [ { "name": "name", "in": "path", "description": "The name of the dataset to update.", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "The updated SQL statement for the dataset's refresh.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccelerationRequest" }, "example": { "refresh_sql": "SELECT * FROM eth_recent_blocks WHERE block_number > 100" } } }, "required": true }, "responses": { "200": { "description": "The refresh SQL was updated successfully." }, "404": { "description": "The specified dataset was not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" }, "example": { "message": "Dataset eth_recent_blocks not found" } } } }, "500": { "description": "An internal server error occurred while updating the refresh SQL", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" }, "example": { "message": "Request failed. An internal server error occurred while updating refresh SQL." } } } } } } }, "/v1/datasets/{name}/acceleration/refresh": { "post": { "tags": [ "Datasets" ], "summary": "Refresh Dataset", "description": "Trigger an on-demand refresh for an accelerated dataset.\n\nThe refresh only applies to `full` and `append` refresh modes (not\n`changes` mode). Datasets without acceleration return 400 — the\nprevious `load: on_demand` flow has been removed; deferred datasets\n(declared schema + `ready_state: on_registration`) are materialised\nautomatically on first query and do not need a manual trigger.", "operationId": "post_dataset_refresh", "parameters": [ { "name": "name", "in": "path", "description": "The name of the dataset to refresh.", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "On-demand refresh request for a specific dataset.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefreshOverrides" }, "example": { "refresh_sql": "SELECT * FROM taxi_trips WHERE tip_amount > 10.0", "refresh_mode": "full", "refresh_jitter_max": "10s" } } }, "required": true }, "responses": { "201": { "description": "Dataset refresh triggered successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" }, "example": { "message": "Dataset refresh triggered for taxi_trips." } } } }, "400": { "description": "Dataset is not accelerated; nothing to refresh", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" }, "example": { "message": "Dataset taxi_trips does not have acceleration enabled" } } } }, "404": { "description": "Dataset not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" }, "example": { "message": "Dataset taxi_trips not found" } } } }, "500": { "description": "Internal server error occurred while processing refresh", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" }, "example": { "message": "Unexpected internal error occurred while processing refresh" } } } } } } }, "/v1/datasets/{name}/cdc": { "post": { "tags": [ "Datasets" ], "summary": "Ingest Debezium CDC changes", "description": "Push Debezium change events (JSON or Avro) directly into an accelerated\ndataset configured with `from: cdc:…` and `refresh_mode: changes`. No Kafka\nis required — use this as a Debezium Server / Embedded Engine sink.", "operationId": "post_dataset_cdc", "parameters": [ { "name": "name", "in": "path", "description": "Dataset name (must match a `from: cdc:…` dataset)", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Debezium change event(s) as JSON or Avro", "content": { "application/avro": { "schema": { "type": "array", "items": { "type": "integer", "format": "int32", "minimum": 0 } } }, "application/json": { "schema": {} }, "application/vnd.debezium+avro": { "schema": { "type": "array", "items": { "type": "integer", "format": "int32", "minimum": 0 } } }, "application/vnd.debezium+json": { "schema": {} } }, "required": true }, "responses": { "200": { "description": "Changes applied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CdcIngestResponse" } } } }, "400": { "description": "Invalid body or format" }, "403": { "description": "Write access required" }, "404": { "description": "Dataset not registered for CDC ingest" }, "501": { "description": "CDC ingest requires the debezium feature in this build" }, "503": { "description": "Change stream stopped (dataset unloaded or reloading)" }, "504": { "description": "Timed out waiting for capacity or apply" } } } }, "/v1/embeddings": { "post": { "tags": [ "AI" ], "summary": "Create Embeddings", "description": "Creates an embedding vector representing the input text.\n\nGet a vector representation of a given input that can be easily consumed by machine learning models and algorithms.", "operationId": "post_embeddings", "requestBody": { "description": "Embedding creation request parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateEmbeddingRequest" }, "example": { "input": "The food was delicious and the waiter...", "model": "text-embedding-ada-002", "encoding_format": "float" } } }, "required": true }, "responses": { "200": { "description": "Embedding created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateEmbeddingResponse" }, "example": { "object": "list", "data": [ { "object": "embedding", "embedding": [ 0.0023064255, -0.009327292, -0.0028842222 ], "index": 0 } ], "model": "text-embedding-ada-002", "usage": { "prompt_tokens": 8, "total_tokens": 8 } } } } }, "404": { "description": "Model not found", "content": { "application/json": { "schema": { "type": "string" }, "example": { "error": "model not found" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "string" }, "example": { "error": "Unexpected internal server error occurred" } } } } } } }, "/v1/evaluate": { "post": { "tags": [ "AI" ], "summary": "Evaluate", "description": "Evaluate unstructured `state` against a map of typed System One questions\n(noul / choice / score). Returns structured answers with calibrated\nprobabilities and confidence. Chat completions are not supported for these\nmodels — use this endpoint instead of `/v1/chat/completions`.", "operationId": "post_evaluate", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EvaluateRequest" } } }, "required": true }, "responses": { "200": { "description": "Evaluation succeeded", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EvaluateResponse" } } } }, "400": { "description": "Invalid request" }, "401": { "description": "Upstream authentication failed" }, "403": { "description": "Upstream permission denied" }, "404": { "description": "Model not found" }, "422": { "description": "Malformed JSON request body (Axum Json extractor)" }, "429": { "description": "Rate limited" }, "503": { "description": "Upstream provider unavailable" }, "500": { "description": "Evaluation failed" } } } }, "/v1/iceberg/config": { "get": { "tags": [ "Iceberg" ], "summary": "Get Iceberg API config", "description": "This endpoint returns the Iceberg Catalog API configuration, including details about overrides, defaults, and available endpoints.", "operationId": "get_config", "responses": { "200": { "description": "API configuration retrieved successfully", "content": { "application/json": { "schema": {}, "example": { "overrides": {}, "defaults": {}, "endpoints": [ "GET /v1/iceberg/namespaces", "HEAD /v1/iceberg/namespaces/{namespace}", "GET /v1/iceberg/namespaces/{namespace}/tables", "HEAD /v1/iceberg/namespaces/{namespace}/tables/{table}", "GET /v1/iceberg/namespaces/{namespace}/tables/{table}" ] } } } } } } }, "/v1/iceberg/namespaces": { "get": { "tags": [ "Iceberg" ], "summary": "List Iceberg namespaces", "description": "This endpoint retrieves namespaces available in the Iceberg catalog.\nIf a `parent` namespace is provided, it will list the child namespaces under the specified parent.", "operationId": "get_iceberg_namespaces", "parameters": [ { "name": "parent", "in": "query", "description": "The parent namespace from which to retrieve child namespaces.", "required": false, "schema": { "$ref": "#/components/schemas/Namespace" } } ], "responses": { "200": { "description": "Namespaces retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NamespacesResponse" }, "example": { "namespaces": [ { "parts": [ "catalog_a" ] }, { "parts": [ "catalog_b", "schema_1" ] } ] } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IcebergResponseError" }, "example": { "error": { "message": "Invalid namespace request", "type": "BadRequestException", "code": 400 } } } } }, "404": { "description": "Namespace not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IcebergResponseError" }, "example": { "error": { "message": "Namespace provided does not exist", "type": "NoSuchNamespaceException", "code": 404 } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IcebergResponseError" }, "example": { "error": { "message": "Internal Server Error: DF_SCHEMA_NOT_FOUND", "type": "InternalServerError", "code": 500 } } } } } } } }, "/v1/iceberg/namespaces/{namespace}": { "get": { "tags": [ "Iceberg" ], "summary": "Check if a namespace exists.", "description": "This endpoint returns a 200 OK response if the namespace exists, otherwise it returns a 404 Not Found response.", "operationId": "get_namespace", "responses": { "200": { "description": "Namespace exists" }, "400": { "description": "Invalid namespace format" }, "404": { "description": "Namespace does not exist" } } }, "head": { "tags": [ "Iceberg" ], "summary": "Check Namespace exists", "description": "This endpoint returns a 200 OK response if the namespace exists, otherwise it returns a 404 Not Found response.", "operationId": "head_namespace", "responses": { "200": { "description": "Namespace exists" }, "400": { "description": "Invalid namespace format" }, "404": { "description": "Namespace does not exist" } } } }, "/v1/iceberg/namespaces/{namespace}/tables": { "get": { "tags": [ "Iceberg" ], "operationId": "list_tables", "responses": { "200": { "description": "Tables retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListTablesResponse" }, "example": { "identifiers": [ { "namespace": { "parts": [ "catalog_a" ] }, "name": "table_1" }, { "namespace": { "parts": [ "catalog_b", "schema_1" ] }, "name": "table_2" } ] } } } }, "400": { "description": "Invalid namespace format" }, "404": { "description": "Namespace does not exist" } } } }, "/v1/iceberg/namespaces/{namespace}/tables/{table}": { "get": { "tags": [ "Iceberg" ], "summary": "Get a table.", "description": "This endpoint returns the table if it exists, otherwise it returns a 404 Not Found response.", "operationId": "get_table", "parameters": [ { "name": "namespace", "in": "path", "description": "The namespace of the table.", "required": true, "schema": { "type": "string" } }, { "name": "table", "in": "path", "description": "The name of the table.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Table exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoadTableResponse" } } } }, "404": { "description": "Table does not exist" }, "500": { "description": "An internal server error occurred while getting the table", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IcebergResponseError" }, "example": { "error": { "message": "Request failed. An internal server error occurred while getting the table.", "r#type": "InternalServerError", "code": 500 } } } } } } }, "head": { "tags": [ "Iceberg" ], "summary": "Check if a table exists.", "description": "This endpoint returns a 200 OK response if the table exists, otherwise it returns a 404 Not Found response.", "operationId": "head_table", "parameters": [ { "name": "namespace", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/NamespacePath" } }, { "name": "table", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Table exists" }, "404": { "description": "Table does not exist" } } } }, "/v1/mcp": { "get": { "tags": [ "mcp" ], "summary": "Open an MCP server-to-client SSE stream", "description": "Open a long-lived server-to-client SSE stream for the current MCP session as defined by the Streamable HTTP transport. The `Mcp-Session-Id` header must identify an existing session created via `POST /v1/mcp`.", "operationId": "mcp_stream", "parameters": [ { "name": "Mcp-Session-Id", "in": "header", "description": "Session identifier returned by the server on `initialize` and required on subsequent requests to maintain MCP session continuity.", "required": false } ], "responses": { "200": { "description": "SSE stream (`text/event-stream`) of server-originated MCP messages." }, "401": { "description": "Unauthorized. The `/v1/mcp` endpoint requires `runtime.auth` to be configured. Configure an API key provider in your Spicepod and retry with credentials." }, "403": { "description": "Forbidden. The `Host` header value is not in the `runtime.mcp.allowed_hosts` list." }, "404": { "description": "Unknown or expired `Mcp-Session-Id`." } } }, "post": { "tags": [ "mcp" ], "summary": "Send a Model Context Protocol message", "description": "Send a JSON-RPC message to the Spice MCP server using the MCP Streamable HTTP transport. The response is either a single JSON-RPC response (`application/json`) or an SSE stream (`text/event-stream`), selected via the `Accept` header. Session continuity is carried via the `Mcp-Session-Id` header.", "operationId": "mcp_message", "parameters": [ { "name": "Mcp-Session-Id", "in": "header", "description": "Session identifier returned by the server on `initialize` and required on subsequent requests to maintain MCP session continuity.", "required": false } ], "responses": { "200": { "description": "JSON-RPC response. Returned as `application/json` for a single response or `text/event-stream` when the server streams additional messages." }, "202": { "description": "Message accepted (for JSON-RPC notifications / responses that do not require a reply)." }, "400": { "description": "Malformed JSON-RPC payload." }, "401": { "description": "Unauthorized. The `/v1/mcp` endpoint requires `runtime.auth` to be configured. Configure an API key provider in your Spicepod and retry with credentials." }, "403": { "description": "Forbidden. The `Host` header value is not in the `runtime.mcp.allowed_hosts` list. Configure `runtime.mcp.allowed_hosts` or set it to `[\"*\"]` to allow all hosts." }, "404": { "description": "Unknown or expired `Mcp-Session-Id`." }, "413": { "description": "Payload too large. Maximum allowed size is 32 MiB." } } }, "delete": { "tags": [ "mcp" ], "summary": "Terminate an MCP Streamable HTTP session", "description": "Terminate the MCP session identified by the `Mcp-Session-Id` header. Subsequent requests bearing the same session id will receive `404 Not Found`.", "operationId": "mcp_terminate_session", "parameters": [ { "name": "Mcp-Session-Id", "in": "header", "description": "Session identifier returned by the server on `initialize` and required on subsequent requests to maintain MCP session continuity.", "required": false } ], "responses": { "204": { "description": "Session terminated." }, "401": { "description": "Unauthorized. The `/v1/mcp` endpoint requires `runtime.auth` to be configured. Configure an API key provider in your Spicepod and retry with credentials." }, "403": { "description": "Forbidden. The `Host` header value is not in the `runtime.mcp.allowed_hosts` list." }, "404": { "description": "Unknown or already-terminated `Mcp-Session-Id`." } } } }, "/v1/models": { "get": { "tags": [ "AI" ], "summary": "List Models", "description": "List all models, both machine learning and language models, available in the runtime.\nWhen `status=true` and a model is in `Error`, the response also includes:\n- `error`: structured code object with `category`, `type`, and stable `code`\n- `error_message`: user-visible details", "operationId": "get_models", "parameters": [ { "name": "format", "in": "query", "description": "The format of the response (e.g., `json` or `csv`).", "required": false, "schema": { "$ref": "#/components/schemas/Format" } }, { "name": "status", "in": "query", "description": "If true, includes the status of each model in the response.", "required": false, "schema": { "type": "boolean" } }, { "name": "metadata_fields", "in": "query", "description": "A comma-separated list of metadata fields to include in the response (e.g., `supports_responses_api`)", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "List of models in JSON format", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelListResponse" }, "example": { "object": "list", "data": [ { "id": "gpt-4", "object": "model", "owned_by": "openai", "datasets": null, "status": "ready", "error": null, "error_message": null }, { "id": "text-embedding-ada-002", "object": "model", "owned_by": "openai-internal", "datasets": [ "text-dataset-1", "text-dataset-2" ], "status": "error", "error": { "category": "model", "type": "auth", "code": "model.auth" }, "error_message": "Invalid API key" } ] } }, "text/csv": { "schema": { "type": "string" }, "example": "\nid,object,owned_by,datasets,status,error,error_message\ngpt-4,model,openai,,ready,,\ntext-embedding-ada-002,model,openai-internal,\"text-dataset-1,text-dataset-2\",error,model.auth,Invalid API key\n" } } }, "500": { "description": "Internal server error occurred while processing models", "content": { "application/json": { "schema": {}, "example": { "error": "App not initialized" } } } } } } }, "/v1/nsql": { "post": { "tags": [ "SQL" ], "summary": "Text-to-SQL (NSQL)", "description": "Generate and optionally execute a natural-language text-to-SQL (NSQL) query.\n\nThis endpoint generates a SQL query using a natural language query (NSQL) and optionally executes it.\nThe SQL query is generated by the specified model and executed if the `Accept` header is not set to `application/sql`.\nWhen `stream` is true, the response is streamed as Server-Sent Events (SSE).", "operationId": "post_nsql", "parameters": [ { "name": "Accept", "in": "header", "description": "The format of the response, one of 'application/json' (default), 'application/vnd.spiceai.nsql.v1+json', 'application/sql', 'text/csv' or 'text/plain'. 'application/sql' will only return the SQL query generated by the model.", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Request body to generate an NSQL query", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Request" }, "example": { "query": "Get the top 5 customers by total sales", "stream": false, "sample_data_enabled": false, "datasets": [ "sales_data" ], "prompt_cache_key": "sales-dashboard" } } }, "required": true }, "responses": { "200": { "description": "SQL query executed successfully", "content": { "application/json": { "schema": { "type": "array", "items": {} }, "example": [ { "customer_id": "12345", "total_sales": 150000 }, { "customer_id": "67890", "total_sales": 125000 } ] }, "application/sql": { "schema": { "type": "string" }, "example": "\n SELECT customer_id, SUM(total_sales)\n FROM sales_data\n GROUP BY customer_id\n ORDER BY SUM(total_sales) DESC\n LIMIT 5\n " }, "application/vnd.spiceai.nsql.v1+json": { "schema": {}, "example": { "row_count": 2, "schema": { "fields": [ { "name": "customer_id", "data_type": "String", "nullable": false, "dict_id": 0, "dict_is_ordered": false }, { "name": "total_sales", "data_type": "Int64", "nullable": false, "dict_id": 0, "dict_is_ordered": false } ] }, "data": [ { "customer_id": "12345", "total_sales": 150000 }, { "customer_id": "67890", "total_sales": 125000 } ], "sql": "SELECT customer_id, SUM(total_sales) AS total_sales\nFROM sales_data\nGROUP BY customer_id\nORDER BY total_sales DESC\nLIMIT 5" } }, "text/event-stream": { "schema": { "type": "string" }, "example": "data: {\"row_count\": 2, \"schema\": {...}, \"data\": [...], \"sql\": \"SELECT ...\"}\n\n" } } }, "400": { "description": "Invalid request parameters", "content": { "application/json": { "schema": { "type": "string" }, "example": "Model nsql not found" } } }, "500": { "description": "Internal server error", "content": { "text/plain": { "schema": { "type": "string" }, "example": "No query produced from NSQL model" } } } } } }, "/v1/nsql/context": { "get": { "tags": [ "SQL" ], "summary": "Text-to-SQL Context (NSQL)", "description": "Return the same context block that `/v1/nsql` injects into the configured NSQL model.\n\nThe response is a markdown/plain-text block or JSON object containing the in-scope datasets, schemas,\nSpice-specific SQL functions, registered user-defined functions, relevant JSON/Spark compatibility functions,\nand optional sample data.", "operationId": "get_nsql_context", "parameters": [ { "name": "Accept", "in": "header", "description": "The format of the response, one of 'text/markdown' (default), 'text/plain', or 'application/json'.", "required": true, "schema": { "type": "string" } }, { "name": "model", "in": "query", "description": "The name of the model whose dataset allowlist should be used. If omitted, Spice defaults to the only compatible LLM model configured in the Spicepod.", "required": false, "schema": { "type": "string" } }, { "name": "include_sampling", "in": "query", "description": "Whether distinct-value samples are included in the context block. Also accepts `sample_data_enabled` for compatibility with `/v1/nsql` request bodies. Default: false.", "required": false, "schema": { "type": "boolean" } }, { "name": "sampling_limit", "in": "query", "description": "Maximum number of rows per distinct-value sample. Default: 3, maximum: 100.", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "include_examples", "in": "query", "description": "Whether example rows are included in the context block. Defaults to `include_sampling` when omitted, matching `/v1/nsql` `sample_data_enabled` behavior.", "required": false, "schema": { "type": "boolean" } }, { "name": "examples_limit", "in": "query", "description": "Maximum number of example rows per dataset. Default: 3, maximum: 100.", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "datasets", "in": "query", "description": "Names of datasets to include in the context block. If omitted, all datasets visible to the selected model are included.", "required": false, "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "NSQL context block", "content": { "text/markdown": { "schema": { "type": "string" }, "example": "# Spice.ai NSQL Context\n\n## Datasets\n- `sales_data`\n\n## Schemas\n| table | column | type | nullable |\n| --- | --- | --- | --- |\n| sales_data | customer_id | Utf8 | false |\n\n## SQL Functions\nUse Spice.ai/DataFusion SQL." }, "text/plain": { "schema": { "type": "string" }, "example": "# Spice.ai NSQL Context\n\n## Datasets\n- `sales_data`" }, "application/json": { "schema": { "$ref": "#/components/schemas/NsqlContextJsonResponse" }, "example": { "context": "# Spice.ai NSQL Context\n- Write SQL for the Spice runtime...", "instructions": [ "Write SQL for the Spice runtime, which uses Apache DataFusion with the SQL parser configured for the PostgreSQL dialect." ], "sql": { "engine": "Apache DataFusion", "version": "52.5.0", "dialect": "PostgreSQL", "parser": "DataFusion SQL parser configured with PostgreSQL dialect", "notes": [ "Spice supports standard DataFusion SQL plus additional Spice-specific and registered user-defined functions listed in this context." ] }, "datasets": [ { "name": "sales.orders", "schema": "sales", "table": "orders", "description": "Customer orders", "metadata": { "description": "Customer orders" }, "columns": [ { "name": "customer_id", "data_type": "Utf8", "nullable": false, "description": "Customer account identifier", "metadata": { "description": "Customer account identifier" }, "primary_key": false, "unique": false, "indexed": true, "vector_search": true, "full_text_search": true } ], "primary_key": [ "order_id" ], "unique_constraints": [], "foreign_keys": [ { "columns": [ "customer_id" ], "foreign_table": "spice.sales.customers", "foreign_columns": [ "id" ] } ], "indexes": [ { "name": "customer_id", "columns": [ "customer_id" ], "kind": "enabled", "source": "spicepod.acceleration.indexes" } ], "search": { "vector": [ { "column": "customer_id", "function": "vector_search", "syntax": "vector_search(sales.orders, 'query text', customer_id)", "model": "embed_model", "engine": "duckdb_vector_index", "row_id_columns": [ "order_id" ], "vector_size": 384, "chunked": false, "index": { "name": "duckdb_vector_index", "columns": [ "customer_id", "order_id" ], "kind": "duckdb_vector_index", "source": "runtime_index" }, "required_columns": [ "customer_id", "order_id" ], "notes": [] } ], "full_text": [ { "column": "customer_id", "function": "text_search", "syntax": "text_search(sales.orders, 'query text', customer_id)", "engine": "tantivy", "index_store": "memory", "row_id_columns": [ "order_id" ], "index": { "name": "full_text", "columns": [ "customer_id", "order_id" ], "kind": "full_text", "source": "runtime_index" }, "required_columns": [ "customer_id", "order_id" ], "notes": [] } ] } } ], "functions": { "summary": "Spice SQL runs on Apache DataFusion with the SQL parser configured for the PostgreSQL dialect.", "json": [], "search": [], "additional": [], "spark_compatibility": { "description": "Spark-compatible scalar functions are available.", "functions": [] }, "user_defined": [] }, "samples": [] } } } }, "400": { "description": "Invalid request parameters", "content": { "text/plain": { "schema": { "type": "string" }, "example": "Dataset 'sales.orders' not found" } } }, "406": { "description": "Requested response content type is not available", "content": { "text/plain": { "schema": { "type": "string" }, "example": "Supported response content types are text/markdown, text/plain, and application/json" } } }, "500": { "description": "Internal server error", "content": { "text/plain": { "schema": { "type": "string" }, "example": "Unexpected internal error. App not prepared in runtime." } } } } } }, "/v1/packages/generate": { "post": { "tags": [ "General" ], "summary": "Generate Package", "description": "This endpoint generates a zip package from a specified GitHub source.", "operationId": "generate_package", "requestBody": { "description": "Parameters required to generate a package", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneratePackageRequest" }, "example": { "from": "github:myorg/myrepo/abc12345/spicepod.yaml", "params": { "github_token": "ghp_exampleToken12345" } } } }, "required": true }, "responses": { "200": { "description": "Package generated successfully", "content": { "application/zip": { "schema": { "type": "array", "items": { "type": "integer", "format": "int32", "minimum": 0 } }, "example": "" } } }, "400": { "description": "Invalid request parameters", "content": { "application/json": { "schema": {}, "example": { "error": "Invalid `from` field, specify a github source and retry (e.g. github:{org}/{repo}/{sha}/{path_to_spicepod.yaml})" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": {}, "example": { "error": "An unexpected error occurred" } } } } } } }, "/v1/ready": { "get": { "tags": [ "Ready" ], "summary": "Check Readiness", "description": "Check the runtime status of all the components of the runtime. If the service is ready, it returns an HTTP 200 status with the message \"ready\". If not, it returns a 503 status with the message \"not ready\".\n\nThe behavior for when an accelerated dataset is considered ready is configurable via the `ready_state` parameter. See [Data refresh](https://spiceai.org/docs/components/data-accelerators/data-refresh#ready-state) for more details.\n\nIn distributed (scheduler) mode the readiness response can additionally be gated on executor\navailability via the `min_ready_executors` and `min_ready_executors_percent` query parameters\n(both optional). Both must pass when supplied. Pass `verbose=true` to get a multi-line\ndiagnostic body explaining each gate.\n\n### Readiness Probe\nIn production deployments, the /v1/ready endpoint can be used as a readiness probe for a Spice deployment to ensure traffic is routed to the Spice runtime only after all datasets have finished loading.\n\nExample Kubernetes readiness probe:\n```yaml\nreadinessProbe:\n httpGet:\n path: /v1/ready\n port: 8090\n```\n\nExample with executor gating (scheduler role):\n```yaml\nreadinessProbe:\n httpGet:\n path: /v1/ready?min_ready_executors=3&min_ready_executors_percent=80\n port: 8090\n```", "operationId": "ready", "parameters": [ { "name": "min_ready_executors", "in": "query", "description": "Minimum number of currently-ready executors required for the probe to succeed. \"Ready\"\nmeans the scheduler has a live `FlightSQL` client for the executor — i.e. it can route\nqueries to it. A value of `0` is treated as \"gate disabled\" and never blocks. Requires\nscheduler role; supplying a non-zero value outside scheduler role returns `400`.", "required": false, "schema": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } }, { "name": "min_ready_executors_percent", "in": "query", "description": "Minimum percentage (0-100) of currently-ready executors relative to the number of\nexecutors currently registered (control stream open). A value of `0` is treated as \"gate\ndisabled\" and never blocks. Values above 100 return `400`. Requires scheduler role;\nsupplying a non-zero value outside scheduler role returns `400`.", "required": false, "schema": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 } }, { "name": "verbose", "in": "query", "description": "When `true`, the response body becomes a multi-line diagnostic listing the result of each\ngate. The HTTP status code is unchanged. Useful for `kubectl describe` / curl debugging.", "required": false, "schema": { "type": "boolean" } } ], "responses": { "200": { "description": "Service is ready", "content": { "text/plain": { "schema": { "type": "string" }, "example": "ready" } } }, "400": { "description": "Invalid query parameter or executor gate requested outside scheduler role", "content": { "text/plain": { "schema": { "type": "string" }, "example": "min_ready_executors_percent must be between 0 and 100" } } }, "503": { "description": "Service is not ready", "content": { "text/plain": { "schema": { "type": "string" }, "example": "not ready" } } } } } }, "/v1/responses": { "post": { "tags": [ "AI" ], "operationId": "post_responses", "requestBody": { "description": "Create a response using the OpenAI Responses API format. This endpoint provides a more flexible conversation interface compared to Chat Completions.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateResponse" }, "example": { "model": "gpt-4o", "input": "You are a helpful assistant.", "stream": false } } }, "required": true }, "responses": { "200": { "description": "Response generated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" }, "example": { "created_at": 1755639134, "id": "resp_68a4ed5e2258819485ece563a803bbf2075163a5e5b1c982", "metadata": {}, "model": "test", "object": "response", "output": [ { "type": "message", "content": [ { "type": "output_text", "annotations": [], "text": "Thank you! How can I assist you today?" } ], "id": "msg_68a4ed5eb7e88194bf0b2560d8b5c0c1075163a5e5b1c982", "role": "assistant", "status": "completed" } ], "parallel_tool_calls": true, "reasoning": {}, "store": true, "service_tier": "default", "status": "completed", "temperature": 1.0, "text": { "format": { "type": "text" } }, "tool_choice": "auto", "tools": [], "top_p": 1.0, "truncation": "disabled", "usage": { "input_tokens": 13, "input_tokens_details": { "audio_tokens": null, "cached_tokens": 0 }, "output_tokens": 11, "output_tokens_details": { "accepted_prediction_tokens": null, "audio_tokens": null, "reasoning_tokens": 0, "rejected_prediction_tokens": null }, "total_tokens": 24 } } } } }, "400": { "description": "The specified model provider does not support the Responses API or the request is invalid" }, "404": { "description": "The specified model was not found" }, "500": { "description": "An internal server error occurred while processing the response", "content": { "application/json": { "schema": {}, "example": { "error": "An internal server error occurred while processing the response." } } } }, "503": { "description": "The specified model is unavailable via the Responses API", "content": { "application/json": { "schema": {}, "example": { "message": "model 'my_model' is unavailable via /v1/responses", "type": "service_unavailable_error", "param": "model", "code": "service_unavailable" } } } } } } }, "/v1/search": { "post": { "tags": [ "Search" ], "summary": "Search", "description": "Perform a vector similarity search (VSS) operation on a dataset.\n\nThe search operation will return the most relevant matches based on cosine similarity with the input `text`.\nThe datasets queries should have an embedding column, and the appropriate embedding model loaded.", "operationId": "post_search", "requestBody": { "description": "Search request parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchRequestHTTPJson" }, "example": { "datasets": [ "app_messages" ], "text": "Tokyo plane tickets", "where": "user=1234321", "additional_columns": [ "timestamp" ], "limit": 3, "keywords": [ "plane", "tickets" ] } } }, "required": true }, "responses": { "200": { "description": "Search completed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchResponse" }, "example": { "results": [ { "matches": { "message": "I booked use some tickets" }, "dataset": "app_messages", "primary_key": { "id": "6fd5a215-0881-421d-ace0-b293b83452b5" }, "data": { "timestamp": 1724716542 }, "_score": 0.914321 }, { "matches": { "message": "direct to Narata" }, "dataset": "app_messages", "primary_key": { "id": "8a25595f-99fb-4404-8c82-e1046d8f4c4b" }, "data": { "timestamp": 1724715881 }, "_score": 0.83221 }, { "matches": { "message": "Yes, we're sitting together" }, "dataset": "app_messages", "primary_key": { "id": "8421ed84-b86d-4b10-b4da-7a432e8912c0" }, "data": { "timestamp": 1724716123 }, "_score": 0.787654321 } ], "duration_ms": 42 } } } }, "400": { "description": "Invalid request parameters", "content": { "application/json": { "schema": {}, "example": { "error": "No data sources provided" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": {}, "example": { "error": "Unexpected internal server error occurred" } } } } } } }, "/v1/spicepods": { "get": { "tags": [ "General" ], "summary": "List Spicepods", "description": "Get a list of spicepods and their summary details.", "operationId": "get_spicepods", "parameters": [ { "name": "format", "in": "query", "description": "The format of the response. Possible values are 'json' (default) or 'csv'.", "required": false, "schema": { "$ref": "#/components/schemas/Format" } } ], "responses": { "200": { "description": "List of spicepods", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/SpicepodSummary" } }, "example": [ { "name": "spicepod1", "version": "v1.0.0", "datasets_count": 3, "models_count": 2, "dependencies_count": 5 }, { "name": "spicepod2", "version": "v2.0.0", "datasets_count": 4, "models_count": 3, "dependencies_count": 2 } ] }, "text/csv": { "schema": { "type": "string" }, "example": "name,version,datasets_count,models_count,dependencies_count\nspicepod1,v1.0.0,3,2,5\nspicepod2,v2.0.0,4,3,2" } } }, "500": { "description": "Internal server error", "content": { "text/plain": { "schema": { "type": "string" }, "example": "Internal server error" } } } } } }, "/v1/sql": { "post": { "tags": [ "SQL" ], "summary": "SQL Query", "description": "Execute a SQL query and return the results.\n\nThis endpoint allows users to execute SQL queries directly from an HTTP request. The SQL query is sent as plain text in the request body.", "operationId": "post_sql", "parameters": [ { "name": "Accept", "in": "header", "description": "The format of the response, one of 'application/json' (default), 'application/vnd.spiceai.sql.v1+json', 'text/csv' or 'text/plain'.", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "SQL query to execute", "content": { "application/json": { "schema": {}, "example": { "sql": "SELECT :foo + 1 AS the_answer", "parameters": { "foo": 41 } } }, "text/plain": { "schema": { "type": "string" }, "example": "SELECT avg(total_amount), avg(tip_amount), count(1), passenger_count FROM my_table GROUP BY passenger_count ORDER BY passenger_count ASC LIMIT 3" } }, "required": true }, "responses": { "200": { "description": "SQL query executed successfully", "content": { "application/json": { "schema": { "type": "array", "items": {} }, "example": [ { "AVG(my_table.tip_amount)": 3.072259971396793, "AVG(my_table.total_amount)": 25.327816939456525, "COUNT(Int64(1))": 31465, "passenger_count": 0 }, { "AVG(my_table.tip_amount)": 3.3712622884680057, "AVG(my_table.total_amount)": 26.205230445474996, "COUNT(Int64(1))": 2188739, "passenger_count": 1 }, { "AVG(my_table.tip_amount)": 3.7171302113290854, "AVG(my_table.total_amount)": 29.520659930930304, "COUNT(Int64(1))": 405103, "passenger_count": 2 } ] }, "text/csv": { "schema": { "type": "string" }, "example": "\"AVG(my_table.tip_amount)\",\"AVG(my_table.total_amount)\",\"COUNT(Int64(1))\",\"passenger_count\"\n3.072259971396793,25.327816939456525,31465,0\n3.3712622884680057,26.205230445474996,2188739,1\n3.7171302113290854,29.520659930930304,405103,2" }, "text/plain": { "schema": { "type": "string" }, "example": "\n +----------------------------+----------------------------+----------------+---------------------+\n | \"AVG(my_table.tip_amount)\" | \"AVG(my_table.total_amount)\" | \"COUNT(Int64(1))\" | \"passenger_count\" |\n +----------------------------+----------------------------+----------------+---------------------+\n | 3.072259971396793 | 25.327816939456525 | 31465 | 0 |\n +----------------------------+----------------------------+----------------+---------------------+\n | 3.3712622884680057 | 26.205230445474996 | 2188739 | 1 |\n +----------------------------+----------------------------+----------------+---------------------+\n | 3.7171302113290854 | 29.520659930930304 | 405103 | 2 |\n +----------------------------+----------------------------+----------------+---------------------+" }, "application/vnd.spiceai.sql.v1+json": { "schema": {}, "example": { "row_count": 3, "schema": { "fields": [ { "name": "AVG(my_table.tip_amount)", "data_type": "Float64", "nullable": false, "dict_id": 0, "dict_is_ordered": false }, { "name": "AVG(my_table.total_amount)", "data_type": "Float64", "nullable": false, "dict_id": 0, "dict_is_ordered": false }, { "name": "COUNT(Int64(1))", "data_type": "Int64", "nullable": false, "dict_id": 0, "dict_is_ordered": false }, { "name": "passenger_count", "data_type": "Int64", "nullable": false, "dict_id": 0, "dict_is_ordered": false } ] }, "data": [ { "AVG(my_table.tip_amount)": 3.072259971396793, "AVG(my_table.total_amount)": 25.327816939456525, "COUNT(Int64(1))": 31465, "passenger_count": 0 }, { "AVG(my_table.tip_amount)": 3.3712622884680057, "AVG(my_table.total_amount)": 26.205230445474996, "COUNT(Int64(1))": 2188739, "passenger_count": 1 }, { "AVG(my_table.tip_amount)": 3.7171302113290854, "AVG(my_table.total_amount)": 29.520659930930304, "COUNT(Int64(1))": 405103, "passenger_count": 2 } ] } } } }, "400": { "description": "Invalid SQL query or malformed input", "content": { "text/plain": { "schema": { "type": "string" }, "example": "Error reading query: invalid UTF-8 sequence" } } }, "500": { "description": "Internal server error", "content": { "text/plain": { "schema": { "type": "string" }, "example": "Unexpected internal server error occurred" } } } } } }, "/v1/status": { "get": { "tags": [ "General" ], "summary": "Check Runtime Status", "description": "Return the status of all connections (http, flight, metrics, opentelemetry) in the runtime.", "operationId": "get_status", "parameters": [ { "name": "format", "in": "query", "description": "The format of the response, either \"json\" or \"csv\". Defaults to \"json\".", "required": false, "schema": { "$ref": "#/components/schemas/Format" } } ], "responses": { "200": { "description": "List of connection statuses", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ConnectionDetails" } }, "example": [ { "name": "http", "endpoint": "http://127.0.0.1:8080", "status": "Ready" }, { "name": "flight", "endpoint": "http://127.0.0.1:9000", "status": "Initializing" }, { "name": "metrics", "endpoint": "N/A", "status": "Disabled" }, { "name": "opentelemetry", "endpoint": "http://127.0.0.1:4317", "status": "Error" } ] }, "text/csv": { "schema": { "type": "string" }, "example": "name,endpoint,status\nhttp,http://127.0.0.1:8080,Ready\nflight,http://127.0.0.1:9000,Initializing\nmetrics,N/A,Disabled\nopentelemetry,http://127.0.0.1:4317,Error" } } }, "500": { "description": "Error converting to CSV", "content": { "text/plain": { "schema": { "type": "string" }, "example": "Error converting to CSV" } } } } } }, "/v1/tools": { "get": { "tags": [ "Tools" ], "summary": "List Tools", "description": "Returns a list of all available tools in the Spice runtime. Tools provide reusable functionality that can be invoked programmatically or by AI agents.", "operationId": "list_tools", "responses": { "200": { "description": "All tools available in the Spice runtime", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ListToolElement" } }, "example": [ { "name": "get_readiness", "description": "Report the readiness state of every Spice runtime component (datasets, accelerators, models, embeddings, catalogs).", "parameters": null }, { "name": "list_datasets", "description": "List every dataset, view, and catalog visible to this runtime.", "parameters": null } ] } } }, "401": { "description": "Tool routes require runtime auth to be configured", "content": { "application/json": { "schema": {}, "example": { "message": "Tool invocation (/v1/tools/*) requires `runtime.auth` to be configured." } } } } } } }, "/v1/tools/search": { "get": { "tags": [ "Tools" ], "summary": "List Searchable Tool Registry Tools", "description": "Returns the small set of tool definitions an external LLM client should inject to use Spice's searchable tool registry. Invoke returned tools with `POST /v1/tools/{name}`.", "operationId": "list_searchable_tool_registry_tools", "parameters": [ { "name": "embedding_model", "in": "query", "description": "Embedding model name to use for searchable tool discovery. Required only when multiple embedding models are configured.", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Searchable tool registry tools to inject into an external LLM prompt", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ListToolElement" } }, "example": [ { "name": "tool_search", "description": "Search the Spice tool registry for tools relevant to the current task.", "parameters": { "type": "object" } }, { "name": "tool_invoke", "description": "Invoke one Spice tool returned by tool_search.", "parameters": { "type": "object" } }, { "name": "list_datasets", "description": "List every dataset, view, and catalog visible to this runtime.", "parameters": null } ] } } }, "400": { "description": "Searchable tool registry is not configured", "content": { "application/json": { "schema": {} } } }, "401": { "description": "Tool routes require runtime auth to be configured", "content": { "application/json": { "schema": {}, "example": { "message": "Tool invocation (/v1/tools/*) requires `runtime.auth` to be configured." } } } } } } }, "/v1/tools/{name}": { "post": { "tags": [ "Tools" ], "summary": "Run Tool", "description": "Execute a specific tool by name. The request body schema and response format are defined by each individual tool's specification. Use `GET /v1/tools` to discover available tools and their parameter schemas.", "operationId": "run_tool", "parameters": [ { "name": "name", "in": "path", "description": "Name of the tool", "required": true, "schema": { "type": "string" } }, { "name": "embedding_model", "in": "query", "description": "Embedding model to use when invoking the searchable tool registry's tool_search meta-tool", "required": false, "schema": { "type": "string" } } ], "requestBody": { "description": "Tool specific input parameters. See /v1/tools for parameter schema.", "content": { "application/json": { "schema": {}, "example": { "query": "SELECT avg(total_amount), avg(tip_amount), count(1), passenger_count FROM my_table GROUP BY passenger_count ORDER BY passenger_count ASC LIMIT 3" } } }, "required": true }, "responses": { "200": { "description": "Tool Specific response, in JSON format", "content": { "application/json": { "schema": {}, "examples": { "sql": { "value": [ { "AVG(my_table.tip_amount)": 3.072259971396793, "AVG(my_table.total_amount)": 25.327816939456525, "COUNT(Int64(1))": 31465, "passenger_count": 0 }, { "AVG(my_table.tip_amount)": 3.3712622884680057, "AVG(my_table.total_amount)": 26.205230445474996, "COUNT(Int64(1))": 2188739, "passenger_count": 1 }, { "AVG(my_table.tip_amount)": 3.7171302113290854, "AVG(my_table.total_amount)": 29.520659930930304, "COUNT(Int64(1))": 405103, "passenger_count": 2 } ] } } } } }, "400": { "description": "Invalid searchable tool registry configuration", "content": { "application/json": { "schema": {} } } }, "401": { "description": "Tool routes require runtime auth to be configured", "content": { "application/json": { "schema": {}, "example": { "message": "Tool invocation (/v1/tools/*) requires `runtime.auth` to be configured." } } } }, "404": { "description": "Tool not found", "content": { "application/json": { "schema": {}, "example": { "message": "Tool 'no_sql' not found" } } } }, "500": { "description": "An error occurred while calling the tool", "content": { "application/json": { "schema": {}, "example": { "message": "Error calling tool no_sql: No such tool" } } } } } } }, "/v1/workers": { "get": { "tags": [ "Workers" ], "summary": "List Workers", "description": "Returns a list of all registered workers in the runtime. Workers are configurable processing units that can perform tasks like load balancing between models or implementing fallback strategies.", "operationId": "get_workers", "parameters": [ { "name": "format", "in": "query", "description": "The format of the response (e.g., `json` or `csv`).", "required": false, "schema": { "$ref": "#/components/schemas/Format" } } ], "responses": { "200": { "description": "List of workers in JSON format", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkerListResponse" }, "example": { "object": "list", "data": [ { "name": "round-robin", "description": "Distributes requests between foo and bar models in a round-robin fashion.\n", "is_llm": true }, { "name": "fallback", "description": "Attempts bar first, then foo, then baz if previous models fail.\n", "is_llm": true } ] } }, "text/csv": { "schema": { "type": "string" }, "example": "\nname,description,type,is_llm\nround-robin,\"Distributes requests between foo and bar models in a round-robin fashion.\",load_balance,true\nfallback,\"Attempts bar first, then foo, then baz if previous models fail.\",load_balance,true\n" } } }, "500": { "description": "Internal server error occurred while processing workers", "content": { "application/json": { "schema": {}, "example": { "error": "App not initialized" } } } } } } } }, "components": { "schemas": { "AccelerationRequest": { "type": "object", "properties": { "refresh_sql": { "type": [ "string", "null" ], "description": "SQL statement used for the refresh. Defaults to current `refresh_sql` configured (either from the spicepod or a previous `refresh_sql` update)." } } }, "Annotation": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/FileCitationBody", "description": "A citation to a file." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "file_citation" ] } } } ], "description": "A citation to a file." }, { "allOf": [ { "$ref": "#/components/schemas/UrlCitationBody", "description": "A citation for a web resource used to generate a model response." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "url_citation" ] } } } ], "description": "A citation for a web resource used to generate a model response." }, { "allOf": [ { "$ref": "#/components/schemas/ContainerFileCitationBody", "description": "A citation for a container file used to generate a model response." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "container_file_citation" ] } } } ], "description": "A citation for a container file used to generate a model response." }, { "allOf": [ { "$ref": "#/components/schemas/FilePath", "description": "A path to a file." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "file_path" ] } } } ], "description": "A path to a file." } ] }, "Answer": { "oneOf": [ { "type": "object", "required": [ "noul", "type" ], "properties": { "noul": { "type": "number", "format": "double" }, "type": { "type": "string", "enum": [ "noul" ] } } }, { "type": "object", "required": [ "choice", "probabilities", "confidence", "type" ], "properties": { "choice": { "type": "string" }, "confidence": { "type": "number", "format": "double" }, "probabilities": { "type": "object", "additionalProperties": { "type": "number", "format": "double" }, "propertyNames": { "type": "string" } }, "type": { "type": "string", "enum": [ "choice" ] } } }, { "type": "object", "required": [ "score", "legend", "probabilities", "confidence", "type" ], "properties": { "confidence": { "type": "number", "format": "double" }, "legend": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/EntryType" }, "propertyNames": { "type": "string" } }, "probabilities": { "type": "object", "additionalProperties": { "type": "number", "format": "double" }, "propertyNames": { "type": "string" } }, "score": { "type": "number", "format": "double" }, "type": { "type": "string", "enum": [ "score" ] } } } ], "description": "A typed answer returned for one question." }, "ApplyPatchCallOutputStatus": { "type": "string", "description": "Outcome values reported for apply_patch tool call outputs.", "enum": [ "completed", "failed" ] }, "ApplyPatchCallOutputStatusParam": { "type": "string", "description": "Outcome values reported for apply_patch tool call outputs.", "enum": [ "completed", "failed" ] }, "ApplyPatchCallStatus": { "type": "string", "description": "Status values reported for apply_patch tool calls.", "enum": [ "in_progress", "completed" ] }, "ApplyPatchCallStatusParam": { "type": "string", "description": "Status values reported for apply_patch tool calls.", "enum": [ "in_progress", "completed" ] }, "ApplyPatchCreateFileOperation": { "type": "object", "description": "Instruction describing how to create a file via the apply_patch tool.", "required": [ "path", "diff" ], "properties": { "diff": { "type": "string", "description": "Diff to apply." }, "path": { "type": "string", "description": "Path of the file to create." } } }, "ApplyPatchCreateFileOperationParam": { "type": "object", "description": "Instruction for creating a new file via the apply_patch tool.", "required": [ "path", "diff" ], "properties": { "diff": { "type": "string", "description": "Unified diff content to apply when creating the file." }, "path": { "type": "string", "description": "Path of the file to create relative to the workspace root." } } }, "ApplyPatchDeleteFileOperation": { "type": "object", "description": "Instruction describing how to delete a file via the apply_patch tool.", "required": [ "path" ], "properties": { "path": { "type": "string", "description": "Path of the file to delete." } } }, "ApplyPatchDeleteFileOperationParam": { "type": "object", "description": "Instruction for deleting an existing file via the apply_patch tool.", "required": [ "path" ], "properties": { "path": { "type": "string", "description": "Path of the file to delete relative to the workspace root." } } }, "ApplyPatchOperation": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ApplyPatchCreateFileOperation" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "create_file" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ApplyPatchDeleteFileOperation" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "delete_file" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ApplyPatchUpdateFileOperation" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "update_file" ] } } } ] } ], "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch." }, "ApplyPatchOperationParam": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ApplyPatchCreateFileOperationParam" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "create_file" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ApplyPatchDeleteFileOperationParam" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "delete_file" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ApplyPatchUpdateFileOperationParam" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "update_file" ] } } } ] } ], "description": "One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool." }, "ApplyPatchToolCall": { "type": "object", "description": "A tool call that applies file diffs by creating, deleting, or updating files.", "required": [ "id", "call_id", "status", "operation" ], "properties": { "call_id": { "type": "string", "description": "The unique ID of the apply patch tool call generated by the model." }, "created_by": { "type": [ "string", "null" ], "description": "The ID of the entity that created this tool call." }, "id": { "type": "string", "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API." }, "operation": { "$ref": "#/components/schemas/ApplyPatchOperation", "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch." }, "status": { "$ref": "#/components/schemas/ApplyPatchCallStatus", "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." } } }, "ApplyPatchToolCallItemParam": { "type": "object", "description": "A tool call representing a request to create, delete, or update files using diff patches.", "required": [ "call_id", "status", "operation" ], "properties": { "call_id": { "type": "string", "description": "The unique ID of the apply patch tool call generated by the model." }, "id": { "type": [ "string", "null" ], "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API." }, "operation": { "$ref": "#/components/schemas/ApplyPatchOperationParam", "description": "The specific create, delete, or update instruction for the apply_patch tool call." }, "status": { "$ref": "#/components/schemas/ApplyPatchCallStatusParam", "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." } } }, "ApplyPatchToolCallOutput": { "type": "object", "description": "The output emitted by an apply patch tool call.", "required": [ "id", "call_id", "status" ], "properties": { "call_id": { "type": "string", "description": "The unique ID of the apply patch tool call generated by the model." }, "created_by": { "type": [ "string", "null" ], "description": "The ID of the entity that created this tool call output." }, "id": { "type": "string", "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API." }, "output": { "type": [ "string", "null" ], "description": "Optional textual output returned by the apply patch tool." }, "status": { "$ref": "#/components/schemas/ApplyPatchCallOutputStatus", "description": "The status of the apply patch tool call output. One of `completed` or `failed`." } } }, "ApplyPatchToolCallOutputItemParam": { "type": "object", "description": "The streamed output emitted by an apply patch tool call.", "required": [ "call_id", "status" ], "properties": { "call_id": { "type": "string", "description": "The unique ID of the apply patch tool call generated by the model." }, "id": { "type": [ "string", "null" ], "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API." }, "output": { "type": [ "string", "null" ], "description": "Optional human-readable log text from the apply patch tool (e.g., patch results or errors)." }, "status": { "$ref": "#/components/schemas/ApplyPatchCallOutputStatusParam", "description": "The status of the apply patch tool call output. One of `completed` or `failed`." } } }, "ApplyPatchUpdateFileOperation": { "type": "object", "description": "Instruction describing how to update a file via the apply_patch tool.", "required": [ "path", "diff" ], "properties": { "diff": { "type": "string", "description": "Diff to apply." }, "path": { "type": "string", "description": "Path of the file to update." } } }, "ApplyPatchUpdateFileOperationParam": { "type": "object", "description": "Instruction for updating an existing file via the apply_patch tool.", "required": [ "path", "diff" ], "properties": { "diff": { "type": "string", "description": "Unified diff content to apply to the existing file." }, "path": { "type": "string", "description": "Path of the file to update relative to the workspace root." } } }, "AssistantRole": { "type": "string", "description": "The role for an output message - always `assistant`.\nThis type ensures type safety by only allowing the assistant role.", "enum": [ "assistant" ] }, "Billing": { "type": "object", "required": [ "payer" ], "properties": { "payer": { "type": "string" } } }, "CatalogInfo": { "type": "object", "description": "Catalog information returned by the `/v1/catalogs` endpoint.", "required": [ "from", "name" ], "properties": { "from": { "type": "string", "description": "The source/provider of the catalog (e.g., `spiceai`, `unity`)" }, "name": { "type": "string", "description": "The name of the catalog" } } }, "CdcIngestResponse": { "type": "object", "required": [ "applied", "dataset" ], "properties": { "applied": { "type": "integer", "description": "Number of change rows applied.", "minimum": 0 }, "dataset": { "type": "string", "description": "Dataset that received the changes." } } }, "ChatChoice": { "type": "object", "required": [ "index", "message" ], "properties": { "finish_reason": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/FinishReason", "description": "The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,\n`length` if the maximum number of tokens specified in the request was reached,\n`content_filter` if content was omitted due to a flag from our content filters,\n`tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function." } ] }, "index": { "type": "integer", "format": "int32", "description": "The index of the choice in the list of choices.", "minimum": 0 }, "logprobs": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ChatChoiceLogprobs", "description": "Log probability information for the choice." } ] }, "message": { "$ref": "#/components/schemas/ChatCompletionResponseMessage" } } }, "ChatChoiceLogprobs": { "type": "object", "properties": { "content": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/ChatCompletionTokenLogprob" }, "description": "A list of message content tokens with log probability information." }, "refusal": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/ChatCompletionTokenLogprob" } } } }, "ChatCompletionAllowedTools": { "type": "object", "required": [ "mode", "tools" ], "properties": { "mode": { "$ref": "#/components/schemas/ToolChoiceAllowedMode", "description": "Constrains the tools available to the model to a pre-defined set.\n\n`auto` allows the model to pick from among the allowed tools and generate a\nmessage.\n\n`required` requires the model to call one or more of the allowed tools." }, "tools": { "type": "array", "items": {}, "description": "A list of tool definitions that the model should be allowed to call.\n\nFor the Chat Completions API, the list of tool definitions might look like:\n```json\n[\n { \"type\": \"function\", \"function\": { \"name\": \"get_weather\" } },\n { \"type\": \"function\", \"function\": { \"name\": \"get_time\" } }\n]\n```" } } }, "ChatCompletionAllowedToolsChoice": { "type": "object", "required": [ "allowed_tools" ], "properties": { "allowed_tools": { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionAllowedTools" } } } }, "ChatCompletionAudio": { "type": "object", "required": [ "voice", "format" ], "properties": { "format": { "$ref": "#/components/schemas/ChatCompletionAudioFormat", "description": "Specifies the output audio format. Must be one of `wav`, `aac`, `mp3`, `flac`, `opus`, or `pcm16`." }, "voice": { "$ref": "#/components/schemas/ChatCompletionAudioVoice", "description": "The voice the model uses to respond. Supported voices are\n`alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`." } } }, "ChatCompletionAudioFormat": { "type": "string", "enum": [ "wav", "aac", "mp3", "flac", "opus", "pcm16" ] }, "ChatCompletionAudioVoice": { "oneOf": [ { "type": "string", "enum": [ "alloy" ] }, { "type": "string", "enum": [ "ash" ] }, { "type": "string", "enum": [ "ballad" ] }, { "type": "string", "enum": [ "coral" ] }, { "type": "string", "enum": [ "echo" ] }, { "type": "string", "enum": [ "fable" ] }, { "type": "string", "enum": [ "nova" ] }, { "type": "string", "enum": [ "onyx" ] }, { "type": "string", "enum": [ "sage" ] }, { "type": "string", "enum": [ "shimmer" ] }, { "type": "object", "required": [ "other" ], "properties": { "other": { "type": "string" } } } ] }, "ChatCompletionFunctionCall": { "oneOf": [ { "type": "string", "description": "The model does not call a function, and responds to the end-user.", "enum": [ "none" ] }, { "type": "string", "description": "The model can pick between an end-user or calling a function.", "enum": [ "auto" ] }, { "type": "object", "description": "Forces the model to call the specified function.", "required": [ "Function" ], "properties": { "Function": { "type": "object", "description": "Forces the model to call the specified function.", "required": [ "name" ], "properties": { "name": { "type": "string" } } } } } ] }, "ChatCompletionFunctions": { "type": "object", "required": [ "name", "parameters" ], "properties": { "description": { "type": [ "string", "null" ], "description": "A description of what the function does, used by the model to choose when and how to call the function." }, "name": { "type": "string", "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64." }, "parameters": { "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list." } } }, "ChatCompletionMessageCustomToolCall": { "type": "object", "required": [ "id", "custom_tool" ], "properties": { "custom_tool": { "$ref": "#/components/schemas/CustomTool", "description": "The custom tool that the model called." }, "id": { "type": "string", "description": "The ID of the tool call." } } }, "ChatCompletionMessageToolCall": { "type": "object", "required": [ "id", "function" ], "properties": { "function": { "$ref": "#/components/schemas/FunctionCall", "description": "The function that the model called." }, "id": { "type": "string", "description": "The ID of the tool call." } } }, "ChatCompletionMessageToolCalls": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionMessageToolCall" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionMessageCustomToolCall" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "custom" ] } } } ] } ] }, "ChatCompletionNamedToolChoice": { "type": "object", "description": "Specifies a tool the model should use. Use to force the model to call a specific function.", "required": [ "function" ], "properties": { "function": { "$ref": "#/components/schemas/FunctionName" } } }, "ChatCompletionNamedToolChoiceCustom": { "type": "object", "required": [ "custom" ], "properties": { "custom": { "$ref": "#/components/schemas/CustomName" } } }, "ChatCompletionRequestAssistantMessage": { "type": "object", "properties": { "audio": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ChatCompletionRequestAssistantMessageAudio", "description": "Data about a previous audio response from the model.\n[Learn more](https://platform.openai.com/docs/guides/audio)." } ] }, "content": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ChatCompletionRequestAssistantMessageContent", "description": "The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified." } ] }, "function_call": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/FunctionCall", "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model." } ] }, "name": { "type": [ "string", "null" ], "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." }, "refusal": { "type": [ "string", "null" ], "description": "The refusal message by the assistant." }, "tool_calls": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/ChatCompletionMessageToolCalls" } } } }, "ChatCompletionRequestAssistantMessageAudio": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Unique identifier for a previous audio response from the model." } } }, "ChatCompletionRequestAssistantMessageContent": { "oneOf": [ { "type": "string", "description": "The text contents of the message." }, { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionRequestAssistantMessageContentPart" }, "description": "An array of content parts with a defined type. Can be one or more of type `text`, or exactly one of type `refusal`." } ] }, "ChatCompletionRequestAssistantMessageContentPart": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartText" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartRefusal" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "refusal" ] } } } ] } ] }, "ChatCompletionRequestDeveloperMessage": { "type": "object", "required": [ "content" ], "properties": { "content": { "$ref": "#/components/schemas/ChatCompletionRequestDeveloperMessageContent", "description": "The contents of the developer message." }, "name": { "type": [ "string", "null" ], "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." } } }, "ChatCompletionRequestDeveloperMessageContent": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionRequestDeveloperMessageContentPart" } } ] }, "ChatCompletionRequestDeveloperMessageContentPart": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartText" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text" ] } } } ] } ] }, "ChatCompletionRequestFunctionMessage": { "type": "object", "required": [ "name" ], "properties": { "content": { "type": [ "string", "null" ], "description": "The return value from the function call, to return to the model." }, "name": { "type": "string", "description": "The name of the function to call." } } }, "ChatCompletionRequestMessage": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestDeveloperMessage" }, { "type": "object", "required": [ "role" ], "properties": { "role": { "type": "string", "enum": [ "developer" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestSystemMessage" }, { "type": "object", "required": [ "role" ], "properties": { "role": { "type": "string", "enum": [ "system" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestUserMessage" }, { "type": "object", "required": [ "role" ], "properties": { "role": { "type": "string", "enum": [ "user" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestAssistantMessage" }, { "type": "object", "required": [ "role" ], "properties": { "role": { "type": "string", "enum": [ "assistant" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestToolMessage" }, { "type": "object", "required": [ "role" ], "properties": { "role": { "type": "string", "enum": [ "tool" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestFunctionMessage" }, { "type": "object", "required": [ "role" ], "properties": { "role": { "type": "string", "enum": [ "function" ] } } } ] } ] }, "ChatCompletionRequestMessageContentPartAudio": { "type": "object", "description": "Learn about [audio inputs](https://platform.openai.com/docs/guides/audio).", "required": [ "input_audio" ], "properties": { "input_audio": { "$ref": "#/components/schemas/InputAudio" } } }, "ChatCompletionRequestMessageContentPartFile": { "type": "object", "required": [ "file" ], "properties": { "file": { "$ref": "#/components/schemas/FileObject" } } }, "ChatCompletionRequestMessageContentPartImage": { "type": "object", "required": [ "image_url" ], "properties": { "image_url": { "$ref": "#/components/schemas/ImageUrl" } } }, "ChatCompletionRequestMessageContentPartRefusal": { "type": "object", "required": [ "refusal" ], "properties": { "refusal": { "type": "string", "description": "The refusal message generated by the model." } } }, "ChatCompletionRequestMessageContentPartText": { "type": "object", "required": [ "text" ], "properties": { "text": { "type": "string" } } }, "ChatCompletionRequestSystemMessage": { "type": "object", "required": [ "content" ], "properties": { "content": { "$ref": "#/components/schemas/ChatCompletionRequestSystemMessageContent", "description": "The contents of the system message." }, "name": { "type": [ "string", "null" ], "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." } } }, "ChatCompletionRequestSystemMessageContent": { "oneOf": [ { "type": "string", "description": "The text contents of the system message." }, { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionRequestSystemMessageContentPart" }, "description": "An array of content parts with a defined type. For system messages, only type `text` is supported." } ] }, "ChatCompletionRequestSystemMessageContentPart": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartText" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text" ] } } } ] } ] }, "ChatCompletionRequestToolMessage": { "type": "object", "description": "Tool message", "required": [ "content", "tool_call_id" ], "properties": { "content": { "$ref": "#/components/schemas/ChatCompletionRequestToolMessageContent", "description": "The contents of the tool message." }, "tool_call_id": { "type": "string" } } }, "ChatCompletionRequestToolMessageContent": { "oneOf": [ { "type": "string", "description": "The text contents of the tool message." }, { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionRequestToolMessageContentPart" }, "description": "An array of content parts with a defined type. For tool messages, only type `text` is supported." } ] }, "ChatCompletionRequestToolMessageContentPart": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartText" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text" ] } } } ] } ] }, "ChatCompletionRequestUserMessage": { "type": "object", "required": [ "content" ], "properties": { "content": { "$ref": "#/components/schemas/ChatCompletionRequestUserMessageContent", "description": "The contents of the user message." }, "name": { "type": [ "string", "null" ], "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." } } }, "ChatCompletionRequestUserMessageContent": { "oneOf": [ { "type": "string", "description": "The text contents of the message." }, { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionRequestUserMessageContentPart" }, "description": "An array of content parts with a defined type. Supported options differ based on the [model](https://platform.openai.com/docs/models) being used to generate the response. Can contain text, image, or audio inputs." } ] }, "ChatCompletionRequestUserMessageContentPart": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartText" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartImage" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "image_url" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartAudio" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_audio" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartFile" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "file" ] } } } ] } ] }, "ChatCompletionResponseMessage": { "type": "object", "description": "A chat completion message generated by the model.", "required": [ "role" ], "properties": { "annotations": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/ChatCompletionResponseMessageAnnotation" } }, "audio": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ChatCompletionResponseMessageAudio", "description": "If the audio output modality is requested, this object contains data about the audio response from the model. [Learn more](https://platform.openai.com/docs/guides/audio)." } ] }, "content": { "type": [ "string", "null" ], "description": "The contents of the message." }, "function_call": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/FunctionCall", "description": "Deprecated and replaced by `tool_calls`.\nThe name and arguments of a function that should be called, as generated by the model." } ] }, "reasoning_content": { "type": [ "string", "null" ], "description": "Reasoning / chain-of-thought content (e.g. extracted from a `` block),\nkept separate from the user-facing `content`. Populated by reasoning models\nsuch as GLM, DeepSeek-R1, and QwQ." }, "refusal": { "type": [ "string", "null" ], "description": "The refusal message generated by the model." }, "role": { "$ref": "#/components/schemas/Role", "description": "The role of the author of this message." }, "tool_calls": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/ChatCompletionMessageToolCalls" }, "description": "The tool calls generated by the model, such as function calls." } } }, "ChatCompletionResponseMessageAnnotation": { "oneOf": [ { "type": "object", "required": [ "url_citation", "type" ], "properties": { "type": { "type": "string", "enum": [ "url_citation" ] }, "url_citation": { "$ref": "#/components/schemas/UrlCitation" } } } ] }, "ChatCompletionResponseMessageAudio": { "type": "object", "required": [ "id", "expires_at", "data", "transcript" ], "properties": { "data": { "type": "string", "description": "Base64 encoded audio bytes generated by the model, in the format specified in the request." }, "expires_at": { "type": "integer", "format": "int64", "description": "The Unix timestamp (in seconds) for when this audio response will no longer be accessible on the server for use in multi-turn conversations.", "minimum": 0 }, "id": { "type": "string", "description": "Unique identifier for this audio response." }, "transcript": { "type": "string", "description": "Transcript of the audio generated by the model." } } }, "ChatCompletionStreamOptions": { "type": "object", "description": "Options for streaming response. Only set this when you set `stream: true`.", "properties": { "include_obfuscation": { "type": [ "boolean", "null" ], "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\nrandom characters to an `obfuscation` field on streaming delta events to\nnormalize payload sizes as a mitigation to certain side-channel attacks.\nThese obfuscation fields are included by default, but add a small amount\nof overhead to the data stream. You can set `include_obfuscation` to\nfalse to optimize for bandwidth if you trust the network links between\nyour application and the OpenAI API." }, "include_usage": { "type": [ "boolean", "null" ], "description": "If set, an additional chunk will be streamed before the `data: [DONE]`\nmessage. The `usage` field on this chunk shows the token usage statistics\nfor the entire request, and the `choices` field will always be an empty\narray.\n\nAll other chunks will also include a `usage` field, but with a null\nvalue. **NOTE:** If the stream is interrupted, you may not receive the\nfinal usage chunk which contains the total token usage for the request." } } }, "ChatCompletionTokenLogprob": { "type": "object", "required": [ "token", "logprob", "top_logprobs" ], "properties": { "bytes": { "type": [ "array", "null" ], "items": { "type": "integer", "format": "int32", "minimum": 0 }, "description": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token." }, "logprob": { "type": "number", "format": "float", "description": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely." }, "token": { "type": "string", "description": "The token." }, "top_logprobs": { "type": "array", "items": { "$ref": "#/components/schemas/TopLogprobs" }, "description": "List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned." } } }, "ChatCompletionTool": { "type": "object", "required": [ "function" ], "properties": { "function": { "$ref": "#/components/schemas/FunctionObject" } } }, "ChatCompletionToolChoiceOption": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionAllowedToolsChoice" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "allowed_tools" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionNamedToolChoice" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionNamedToolChoiceCustom" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "custom" ] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/ToolChoiceOptions" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "mode" ] } } } ] } ], "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools.\nSpecifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n\n`none` is the default when no tools are present. `auto` is the default if tools are present." }, "ChatCompletionTools": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ChatCompletionTool", "description": "A function tool that can be used to generate a response." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function" ] } } } ], "description": "A function tool that can be used to generate a response." }, { "allOf": [ { "$ref": "#/components/schemas/CustomToolChatCompletions", "description": "A custom tool that processes input using a specified format." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "custom" ] } } } ], "description": "A custom tool that processes input using a specified format." } ] }, "ClickButtonType": { "type": "string", "enum": [ "left", "right", "wheel", "back", "forward" ] }, "ClickParam": { "type": "object", "description": "A click action.", "required": [ "button", "x", "y" ], "properties": { "button": { "$ref": "#/components/schemas/ClickButtonType", "description": "Indicates which mouse button was pressed during the click. One of `left`,\n`right`, `wheel`, `back`, or `forward`." }, "x": { "type": "integer", "format": "int32", "description": "The x-coordinate where the click occurred." }, "y": { "type": "integer", "format": "int32", "description": "The y-coordinate where the click occurred." } } }, "CodeInterpreterContainerAuto": { "type": "object", "description": "Auto configuration for code interpreter container.", "properties": { "file_ids": { "type": [ "array", "null" ], "items": { "type": "string" }, "description": "An optional list of uploaded files to make available to your code." }, "memory_limit": { "type": [ "integer", "null" ], "format": "int64", "minimum": 0 } } }, "CodeInterpreterOutputImage": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string", "description": "The URL of the image output from the code interpreter." } } }, "CodeInterpreterOutputLogs": { "type": "object", "required": [ "logs" ], "properties": { "logs": { "type": "string", "description": "The logs output from the code interpreter." } } }, "CodeInterpreterTool": { "type": "object", "required": [ "container" ], "properties": { "container": { "$ref": "#/components/schemas/CodeInterpreterToolContainer", "description": "The code interpreter container. Can be a container ID or an object that\nspecifies uploaded file IDs to make available to your code, along with an\noptional `memory_limit` setting." } } }, "CodeInterpreterToolCall": { "type": "object", "description": "Output of a code interpreter request.", "required": [ "container_id", "id", "status" ], "properties": { "code": { "type": [ "string", "null" ], "description": "The code to run, or null if not available." }, "container_id": { "type": "string", "description": "ID of the container used to run the code." }, "id": { "type": "string", "description": "The unique ID of the code interpreter tool call." }, "outputs": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/CodeInterpreterToolCallOutput" }, "description": "The outputs generated by the code interpreter, such as logs or images.\nCan be null if no outputs are available." }, "status": { "$ref": "#/components/schemas/CodeInterpreterToolCallStatus", "description": "The status of the code interpreter tool call.\nValid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`." } } }, "CodeInterpreterToolCallOutput": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/CodeInterpreterOutputLogs", "description": "Code interpreter output logs" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "logs" ] } } } ], "description": "Code interpreter output logs" }, { "allOf": [ { "$ref": "#/components/schemas/CodeInterpreterOutputImage", "description": "Code interpreter output image" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "image" ] } } } ], "description": "Code interpreter output image" } ], "description": "Individual result from a code interpreter: either logs or files." }, "CodeInterpreterToolCallStatus": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "CodeInterpreterToolContainer": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/CodeInterpreterContainerAuto", "description": "Configuration for a code interpreter container. Optionally specify the IDs of the\nfiles to run the code on." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "auto" ] } } } ], "description": "Configuration for a code interpreter container. Optionally specify the IDs of the\nfiles to run the code on." }, { "type": "object", "description": "The container ID.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "container_i_d" ] } } } ], "description": "Container configuration for a code interpreter." }, "CompactionBody": { "type": "object", "description": "A compaction item generated by the `/v1/responses/compact` API.", "required": [ "id", "encrypted_content" ], "properties": { "created_by": { "type": [ "string", "null" ], "description": "Created by model/user identifier." }, "encrypted_content": { "type": "string", "description": "The encrypted content." }, "id": { "type": "string", "description": "The unique ID of the compaction item." } } }, "CompactionSummaryItemParam": { "type": "object", "description": "A compaction item generated by the `/v1/responses/compact` API.", "required": [ "encrypted_content" ], "properties": { "encrypted_content": { "type": "string", "description": "The encrypted content." }, "id": { "type": [ "string", "null" ], "description": "The ID of the compaction item." } } }, "ComparisonFilter": { "type": "object", "description": "Single comparison filter.", "required": [ "type", "key", "value" ], "properties": { "key": { "type": "string", "description": "The key to compare against the value." }, "type": { "$ref": "#/components/schemas/ComparisonType", "description": "Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.\n- `eq`: equals\n- `ne`: not equal\n- `gt`: greater than\n- `gte`: greater than or equal\n- `lt`: less than\n- `lte`: less than or equal\n- `in`: in\n- `nin`: not in" }, "value": { "description": "The value to compare against the attribute key; supports string, number, or boolean types." } } }, "ComparisonType": { "type": "string", "enum": [ "eq", "ne", "gt", "gte", "lt", "lte", "in", "nin" ] }, "CompletionTokensDetails": { "type": "object", "description": "Breakdown of tokens used in a completion.", "properties": { "accepted_prediction_tokens": { "type": [ "integer", "null" ], "format": "int32", "minimum": 0 }, "audio_tokens": { "type": [ "integer", "null" ], "format": "int32", "description": "Audio input tokens generated by the model.", "minimum": 0 }, "reasoning_tokens": { "type": [ "integer", "null" ], "format": "int32", "description": "Tokens generated by the model for reasoning.", "minimum": 0 }, "rejected_prediction_tokens": { "type": [ "integer", "null" ], "format": "int32", "description": " When using Predicted Outputs, the number of tokens in the\nprediction that did not appear in the completion. However, like\nreasoning tokens, these tokens are still counted in the total\ncompletion tokens for purposes of billing, output, and context\nwindow limits.", "minimum": 0 } } }, "CompletionUsage": { "type": "object", "description": "Usage statistics for the completion request.", "required": [ "prompt_tokens", "completion_tokens", "total_tokens" ], "properties": { "completion_tokens": { "type": "integer", "format": "int32", "description": "Number of tokens in the generated completion.", "minimum": 0 }, "completion_tokens_details": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/CompletionTokensDetails", "description": "Breakdown of tokens used in a completion." } ] }, "prompt_tokens": { "type": "integer", "format": "int32", "description": "Number of tokens in the prompt.", "minimum": 0 }, "prompt_tokens_details": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/PromptTokensDetails", "description": "Breakdown of tokens used in the prompt." } ] }, "total_tokens": { "type": "integer", "format": "int32", "description": "Total number of tokens used in the request (prompt + completion).", "minimum": 0 } } }, "ComponentError": { "type": "object", "required": [ "category", "type", "code" ], "properties": { "category": { "$ref": "#/components/schemas/ComponentErrorCategory", "description": "High-level component category where the error originated." }, "code": { "type": "string", "description": "Stable machine-readable code (`{category}.{type}`), e.g. `dataset.auth`." }, "type": { "$ref": "#/components/schemas/ComponentErrorType", "description": "Canonical error type intended for programmatic handling." } } }, "ComponentErrorCategory": { "type": "string", "enum": [ "dataset", "model", "worker", "runtime" ] }, "ComponentErrorType": { "type": "string", "enum": [ "auth", "connection", "timeout", "validation", "not_found", "permission", "rate_limit", "internal", "unknown" ] }, "CompoundFilter": { "type": "object", "description": "Combine multiple filters using `and` or `or`.", "required": [ "type", "filters" ], "properties": { "filters": { "type": "array", "items": { "$ref": "#/components/schemas/Filter" }, "description": "Array of filters to combine. Items can be ComparisonFilter or CompoundFilter." }, "type": { "$ref": "#/components/schemas/CompoundType", "description": "'Type of operation: `and` or `or`.'" } } }, "ComputerAction": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ClickParam", "description": "A click action." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "click" ] } } } ], "description": "A click action." }, { "allOf": [ { "$ref": "#/components/schemas/DoubleClickAction", "description": "A double click action." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "double_click" ] } } } ], "description": "A double click action." }, { "allOf": [ { "$ref": "#/components/schemas/Drag", "description": "A drag action." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "drag" ] } } } ], "description": "A drag action." }, { "allOf": [ { "$ref": "#/components/schemas/KeyPressAction", "description": "A collection of keypresses the model would like to perform." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "keypress" ] } } } ], "description": "A collection of keypresses the model would like to perform." }, { "allOf": [ { "$ref": "#/components/schemas/Move", "description": "A mouse move action." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "move" ] } } } ], "description": "A mouse move action." }, { "type": "object", "description": "A screenshot action.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "screenshot" ] } } }, { "allOf": [ { "$ref": "#/components/schemas/Scroll", "description": "A scroll action." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "scroll" ] } } } ], "description": "A scroll action." }, { "allOf": [ { "$ref": "#/components/schemas/Type", "description": "An action to type in text." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "type" ] } } } ], "description": "An action to type in text." }, { "type": "object", "description": "A wait action.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "wait" ] } } } ], "description": "Represents all user‐triggered actions." }, "ComputerCallOutputItemParam": { "type": "object", "required": [ "call_id", "output" ], "properties": { "acknowledged_safety_checks": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/ComputerCallSafetyCheckParam" }, "description": "The safety checks reported by the API that have been acknowledged by the developer." }, "call_id": { "type": "string", "description": "The ID of the computer tool call that produced the output." }, "id": { "type": [ "string", "null" ], "description": "The unique ID of the computer tool call output. Optional when creating." }, "output": { "$ref": "#/components/schemas/ComputerScreenshotImage", "description": "A computer screenshot image used with the computer use tool." }, "status": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/OutputStatus", "description": "The status of the message input. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when input items are returned via API." } ] } } }, "ComputerCallSafetyCheckParam": { "type": "object", "required": [ "id" ], "properties": { "code": { "type": [ "string", "null" ], "description": "The type of the pending safety check." }, "id": { "type": "string", "description": "The ID of the pending safety check." }, "message": { "type": [ "string", "null" ], "description": "Details about the pending safety check." } } }, "ComputerEnvironment": { "type": "string", "enum": [ "windows", "mac", "linux", "ubuntu", "browser" ] }, "ComputerScreenshotImage": { "type": "object", "description": "A computer screenshot image used with the computer use tool.", "required": [ "type" ], "properties": { "file_id": { "type": [ "string", "null" ], "description": "The identifier of an uploaded file that contains the screenshot." }, "image_url": { "type": [ "string", "null" ], "description": "The URL of the screenshot image." }, "type": { "$ref": "#/components/schemas/ComputerScreenshotImageType", "description": "Specifies the event type. For a computer screenshot, this property is always\nset to `computer_screenshot`." } } }, "ComputerScreenshotImageType": { "type": "string", "enum": [ "computer_screenshot" ] }, "ComputerToolCall": { "type": "object", "description": "Output from a computer tool call.", "required": [ "action", "call_id", "id", "pending_safety_checks", "status" ], "properties": { "action": { "$ref": "#/components/schemas/ComputerAction" }, "call_id": { "type": "string", "description": "An identifier used when responding to the tool call with output." }, "id": { "type": "string", "description": "The unique ID of the computer call." }, "pending_safety_checks": { "type": "array", "items": { "$ref": "#/components/schemas/ComputerCallSafetyCheckParam" }, "description": "The pending safety checks for the computer call." }, "status": { "$ref": "#/components/schemas/OutputStatus", "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API." } } }, "ComputerUsePreviewTool": { "type": "object", "required": [ "environment", "display_width", "display_height" ], "properties": { "display_height": { "type": "integer", "format": "int32", "description": "The height of the computer display.", "minimum": 0 }, "display_width": { "type": "integer", "format": "int32", "description": "The width of the computer display.", "minimum": 0 }, "environment": { "$ref": "#/components/schemas/ComputerEnvironment", "description": "The type of computer environment to control." } } }, "ConnectionDetails": { "type": "object", "required": [ "name", "endpoint", "status" ], "properties": { "endpoint": { "type": "string", "description": "The endpoint of the connection (e.g., URL or IP address)" }, "name": { "type": "string", "description": "The name of the connection (e.g., \"http\", \"flight\", \"metrics\", \"opentelemetry\")" }, "status": { "$ref": "#/components/schemas/String", "description": "The status of the component (e.g., Ready, Initializing, Disabled, Error, etc.)" } } }, "ContainerFileCitationBody": { "type": "object", "required": [ "container_id", "end_index", "file_id", "filename", "start_index" ], "properties": { "container_id": { "type": "string", "description": "The ID of the container file." }, "end_index": { "type": "integer", "format": "int32", "description": "The index of the last character of the container file citation in the message.", "minimum": 0 }, "file_id": { "type": "string", "description": "The ID of the file." }, "filename": { "type": "string", "description": "The filename of the container file cited." }, "start_index": { "type": "integer", "format": "int32", "description": "The index of the first character of the container file citation in the message.", "minimum": 0 } } }, "Conversation": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "The unique ID of the conversation." } } }, "ConversationParam": { "oneOf": [ { "type": "string", "description": "The unique ID of the conversation." }, { "$ref": "#/components/schemas/Conversation", "description": "The conversation that this response belongs to." } ] }, "CreateChatCompletionRequest": { "type": "object", "required": [ "messages", "model" ], "properties": { "audio": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ChatCompletionAudio", "description": "Parameters for audio output. Required when audio output is requested with\n`modalities: [\"audio\"]`. [Learn more](https://platform.openai.com/docs/guides/audio)." } ] }, "frequency_penalty": { "type": [ "number", "null" ], "format": "float", "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\ntheir existing frequency in the text so far, decreasing the model's\nlikelihood to repeat the same line verbatim." }, "function_call": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ChatCompletionFunctionCall", "description": "Deprecated in favor of `tool_choice`.\n\nControls which (if any) function is called by the model.\n`none` means the model will not call a function and instead generates a message.\n`auto` means the model can pick between generating a message or calling a function.\nSpecifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.\n\n`none` is the default when no functions are present. `auto` is the default if functions are present." } ] }, "functions": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/ChatCompletionFunctions" }, "description": "Deprecated in favor of `tools`.\n\nA list of functions the model may generate JSON inputs for.", "deprecated": true }, "logit_bias": { "type": [ "object", "null" ], "description": "Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100.\nMathematically, the bias is added to the logits generated by the model prior to sampling.\nThe exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection;\nvalues like -100 or 100 should result in a ban or exclusive selection of the relevant token.", "additionalProperties": { "type": "integer", "format": "int32" }, "propertyNames": { "type": "string" } }, "logprobs": { "type": [ "boolean", "null" ], "description": "Whether to return log probabilities of the output tokens or not. If true,\nreturns the log probabilities of each output token returned in the `content` of `message`." }, "max_completion_tokens": { "type": [ "integer", "null" ], "format": "int32", "description": "An upper bound for the number of tokens that can be generated for a completion, including\nvisible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).", "minimum": 0 }, "max_tokens": { "type": [ "integer", "null" ], "format": "int32", "description": "The maximum number of [tokens](https://platform.openai.com/tokenizer) that can be generated in\nthe chat completion. This value can be used to control [costs](https://openai.com/api/pricing/) for text generated via API.\nThis value is now deprecated in favor of `max_completion_tokens`, and is\nnot compatible with [o-series models](https://platform.openai.com/docs/guides/reasoning).", "deprecated": true, "minimum": 0 }, "messages": { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionRequestMessage" }, "description": "A list of messages comprising the conversation so far. Depending on the\n[model](https://platform.openai.com/docs/models) you use, different message types (modalities)\nare supported, like [text](https://platform.openai.com/docs/guides/text-generation),\n[images](https://platform.openai.com/docs/guides/vision), and\n[audio](https://platform.openai.com/docs/guides/audio)." }, "metadata": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Metadata", "description": "Developer-defined tags and values used for filtering completions in the [dashboard](https://platform.openai.com/chat-completions)." } ] }, "modalities": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/ResponseModalities" }, "description": "Output types that you would like the model to generate. Most models are capable of generating\ntext, which is the default:\n\n`[\"text\"]`\nThe `gpt-4o-audio-preview` model can also be used to\n[generate audio](https://platform.openai.com/docs/guides/audio). To request that this model\ngenerate both text and audio responses, you can use:\n\n`[\"text\", \"audio\"]`" }, "model": { "type": "string", "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\noffers a wide range of models with different capabilities, performance\ncharacteristics, and price points. Refer to the\n[model guide](https://platform.openai.com/docs/models)\nto browse and compare available models." }, "n": { "type": [ "integer", "null" ], "format": "int32", "description": "How many chat completion choices to generate for each input message. Note that you will be\ncharged based on the number of generated tokens across all of the choices. Keep `n` as `1` to\nminimize costs.", "minimum": 0 }, "parallel_tool_calls": { "type": [ "boolean", "null" ], "description": "Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling)\nduring tool use." }, "prediction": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/PredictionContent", "description": "Configuration for a [Predicted Output](https://platform.openai.com/docs/guides/predicted-outputs),\nwhich can greatly improve response times when large parts of the model\nresponse are known ahead of time. This is most common when you are\nregenerating a file with only minor changes to most of the content." } ] }, "presence_penalty": { "type": [ "number", "null" ], "format": "float", "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\nwhether they appear in the text so far, increasing the model's likelihood\nto talk about new topics." }, "prompt_cache_key": { "type": [ "string", "null" ], "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces\nthe `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." }, "reasoning_effort": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ReasoningEffort", "description": "Constrains effort on reasoning for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `minimal`, `low`, `medium`, and `high`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.\nNote: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort." } ] }, "response_format": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ResponseFormat", "description": "An object specifying the format that the model must output.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).\n\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it." } ] }, "safety_identifier": { "type": [ "string", "null" ], "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's\nusage policies.\n\nThe IDs should be a string that uniquely identifies each user. We recommend hashing their username\nor email address, in order to avoid sending us any identifying information. [Learn\nmore](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." }, "seed": { "type": [ "integer", "null" ], "format": "int64", "description": "This feature is in Beta.\n\nIf specified, our system will make a best effort to sample deterministically, such that\nrepeated requests with the same `seed` and parameters should return the same result.\n\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response\nparameter to monitor changes in the backend.", "deprecated": true }, "service_tier": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ServiceTier", "description": "Specifies the processing type used for serving the request.\n- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n- If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.\n- When not set, the default behavior is 'auto'.\n\nWhen the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter." } ] }, "stop": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/StopConfiguration", "description": "Not supported with latest reasoning models `o3` and `o4-mini`.\n\nUp to 4 sequences where the API will stop generating further tokens. The\nreturned text will not contain the stop sequence." } ] }, "store": { "type": [ "boolean", "null" ], "description": "Whether or not to store the output of this chat completion request for\nuse in our [model distillation](https://platform.openai.com/docs/guides/distillation) or\n[evals](https://platform.openai.com/docs/guides/evals) products.\n\nSupports text and image inputs. Note: image inputs over 8MB will be dropped." }, "stream": { "type": [ "boolean", "null" ], "description": "If set to true, the model response data will be streamed to the client\nas it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).\nSee the [Streaming section below](https://platform.openai.com/docs/api-reference/chat/streaming)\nfor more information, along with the [streaming responses](https://platform.openai.com/docs/guides/streaming-responses)\nguide for more information on how to handle the streaming events." }, "stream_options": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ChatCompletionStreamOptions" } ] }, "temperature": { "type": [ "number", "null" ], "format": "float", "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random,\nwhile lower values like 0.2 will make it more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both." }, "tool_choice": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ChatCompletionToolChoiceOption", "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools.\nSpecifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces\nthe model to call that tool.\n`none` is the default when no tools are present. `auto` is the default if tools are present." } ] }, "tools": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/ChatCompletionTools" }, "description": "A list of tools the model may call. You can provide either\n[custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) or\n[function tools](https://platform.openai.com/docs/guides/function-calling)." }, "top_logprobs": { "type": [ "integer", "null" ], "format": "int32", "description": "An integer between 0 and 20 specifying the number of most likely tokens to\nreturn at each token position, each with an associated log probability.\n`logprobs` must be set to `true` if this parameter is used.", "minimum": 0 }, "top_p": { "type": [ "number", "null" ], "format": "float", "description": "An alternative to sampling with temperature, called nucleus sampling,\nwhere the model considers the results of the tokens with top_p probability mass.\nSo 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\n We generally recommend altering this or `temperature` but not both." }, "user": { "type": [ "string", "null" ], "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key`\ninstead to maintain caching optimizations.\nA stable identifier for your end-users.\nUsed to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and\nprevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).", "deprecated": true }, "verbosity": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Verbosity", "description": "Constrains the verbosity of the model's response. Lower values will result in\nmore concise responses, while higher values will result in more verbose responses.\nCurrently supported values are `low`, `medium`, and `high`." } ] }, "web_search_options": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/WebSearchOptions", "description": "This tool searches the web for relevant results to use in a response.\nLearn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat)." } ] } } }, "CreateChatCompletionResponse": { "type": "object", "description": "Represents a chat completion response returned by model, based on the provided input.", "required": [ "id", "choices", "created", "model", "object" ], "properties": { "choices": { "type": "array", "items": { "$ref": "#/components/schemas/ChatChoice" }, "description": "A list of chat completion choices. Can be more than one if `n` is greater than 1." }, "created": { "type": "integer", "format": "int32", "description": "The Unix timestamp (in seconds) of when the chat completion was created.", "minimum": 0 }, "id": { "type": "string", "description": "A unique identifier for the chat completion." }, "model": { "type": "string", "description": "The model used for the chat completion." }, "object": { "type": "string", "description": "The object type, which is always `chat.completion`." }, "service_tier": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ServiceTier", "description": "The service tier used for processing the request. This field is only included if the `service_tier` parameter is specified in the request." } ] }, "system_fingerprint": { "type": [ "string", "null" ], "description": "This fingerprint represents the backend configuration that the model runs with.\n\nCan be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.", "deprecated": true }, "usage": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/CompletionUsage" } ] } } }, "CreateEmbeddingRequest": { "type": "object", "required": [ "model", "input" ], "properties": { "dimensions": { "type": [ "integer", "null" ], "format": "int32", "description": "The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.", "minimum": 0 }, "encoding_format": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/EncodingFormat", "description": "The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/)." } ] }, "input": { "$ref": "#/components/schemas/EmbeddingInput", "description": "Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single\nrequest, pass an array of strings or array of token arrays. The input must not exceed the max\ninput tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and\nany array must be 2048 dimensions or less. [Example Python\ncode](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.\nIn addition to the per-input token limit, all embedding models enforce a maximum of 300,000\ntokens summed across all inputs in a single request." }, "model": { "type": "string", "description": "ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list)\nAPI to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models)\nfor descriptions of them." }, "user": { "type": [ "string", "null" ], "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.\n[Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids)." } } }, "CreateEmbeddingResponse": { "type": "object", "required": [ "object", "model", "data", "usage" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Embedding" }, "description": "The list of embeddings generated by the model." }, "model": { "type": "string", "description": "The name of the model used to generate the embedding." }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/EmbeddingUsage", "description": "The usage information for the request." } } }, "CreateResponse": { "type": "object", "description": "Builder for a Responses API request.", "required": [ "input" ], "properties": { "background": { "type": [ "boolean", "null" ], "description": "Whether to run the model response in the background.\n[Learn more](https://platform.openai.com/docs/guides/background)." }, "conversation": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ConversationParam", "description": "The conversation that this response belongs to. Items from this conversation are prepended to\n `input_items` for this response request.\n\nInput items and output items from this response are automatically added to this conversation after\nthis response completes." } ] }, "include": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/IncludeEnum" }, "description": "Specify additional output data to include in the model response. Currently supported\nvalues are:\n\n- `web_search_call.action.sources`: Include the sources of the web search tool call.\n\n- `code_interpreter_call.outputs`: Includes the outputs of python code execution in code\n interpreter tool call items.\n\n- `computer_call_output.output.image_url`: Include image urls from the computer call\n output.\n\n- `file_search_call.results`: Include the search results of the file search tool call.\n\n- `message.input_image.image_url`: Include image urls from the input message.\n\n- `message.output_text.logprobs`: Include logprobs with assistant messages.\n\n- `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in\n reasoning item outputs. This enables reasoning items to be used in multi-turn\n conversations when using the Responses API statelessly (like when the `store` parameter is\n set to `false`, or when an organization is enrolled in the zero data retention program)." }, "input": { "$ref": "#/components/schemas/InputParam", "description": "Text, image, or file inputs to the model, used to generate a response.\n\nLearn more:\n- [Text inputs and outputs](https://platform.openai.com/docs/guides/text)\n- [Image inputs](https://platform.openai.com/docs/guides/images)\n- [File inputs](https://platform.openai.com/docs/guides/pdf-files)\n- [Conversation state](https://platform.openai.com/docs/guides/conversation-state)\n- [Function calling](https://platform.openai.com/docs/guides/function-calling)" }, "instructions": { "type": [ "string", "null" ], "description": "A system (or developer) message inserted into the model's context.\n\nWhen using along with `previous_response_id`, the instructions from a previous\nresponse will not be carried over to the next response. This makes it simple\nto swap out system (or developer) messages in new responses." }, "max_output_tokens": { "type": [ "integer", "null" ], "format": "int32", "description": "An upper bound for the number of tokens that can be generated for a response, including\nvisible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).", "minimum": 0 }, "max_tool_calls": { "type": [ "integer", "null" ], "format": "int32", "description": "The maximum number of total calls to built-in tools that can be processed in a response. This\nmaximum number applies across all built-in tool calls, not per individual tool. Any further\nattempts to call a tool by the model will be ignored.", "minimum": 0 }, "metadata": { "type": [ "object", "null" ], "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are\nstrings with a maximum length of 512 characters.", "additionalProperties": { "type": "string" }, "propertyNames": { "type": "string" } }, "model": { "type": [ "string", "null" ], "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\noffers a wide range of models with different capabilities, performance\ncharacteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\nto browse and compare available models." }, "parallel_tool_calls": { "type": [ "boolean", "null" ], "description": "Whether to allow the model to run tool calls in parallel." }, "previous_response_id": { "type": [ "string", "null" ], "description": "The unique ID of the previous response to the model. Use this to create multi-turn conversations.\nLearn more about [conversation state](https://platform.openai.com/docs/guides/conversation-state).\nCannot be used in conjunction with `conversation`." }, "prompt": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Prompt", "description": "Reference to a prompt template and its variables.\n[Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts)." } ] }, "prompt_cache_key": { "type": [ "string", "null" ], "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces\nthe `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." }, "prompt_cache_retention": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/PromptCacheRetention", "description": "The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching,\nwhich keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn\nmore](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention)." } ] }, "reasoning": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Reasoning", "description": "**gpt-5 and o-series models only**\nConfiguration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning)." } ] }, "safety_identifier": { "type": [ "string", "null" ], "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's\nusage policies.\n\nThe IDs should be a string that uniquely identifies each user. We recommend hashing their username\nor email address, in order to avoid sending us any identifying information. [Learn\nmore](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." }, "service_tier": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ServiceTier", "description": "Specifies the processing type used for serving the request.\n- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n- If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.\n- When not set, the default behavior is 'auto'.\n\nWhen the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter." } ] }, "store": { "type": [ "boolean", "null" ], "description": "Whether to store the generated model response for later retrieval via API." }, "stream": { "type": [ "boolean", "null" ], "description": "If set to true, the model response data will be streamed to the client\nas it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format).\nSee the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming)\nfor more information." }, "stream_options": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ResponseStreamOptions", "description": "Options for streaming responses. Only set this when you set `stream: true`." } ] }, "temperature": { "type": [ "number", "null" ], "format": "float", "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8\nwill make the output more random, while lower values like 0.2 will make it\nmore focused and deterministic. We generally recommend altering this or\n`top_p` but not both." }, "text": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ResponseTextParam", "description": "Configuration options for a text response from the model. Can be plain\ntext or structured JSON data. Learn more:\n- [Text inputs and outputs](https://platform.openai.com/docs/guides/text)\n- [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)" } ] }, "tool_choice": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ToolChoiceParam", "description": "How the model should select which tool (or tools) to use when generating\na response. See the `tools` parameter to see how to specify which tools\nthe model can call." } ] }, "tools": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/Tool" }, "description": "An array of tools the model may call while generating a response. You\ncan specify which tool to use by setting the `tool_choice` parameter.\n\nWe support the following categories of tools:\n- **Built-in tools**: Tools that are provided by OpenAI that extend the\n model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search)\n or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about\n [built-in tools](https://platform.openai.com/docs/guides/tools).\n- **MCP Tools**: Integrations with third-party systems via custom MCP servers\n or predefined connectors such as Google Drive and SharePoint. Learn more about\n [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).\n- **Function calls (custom tools)**: Functions that are defined by you,\n enabling the model to call your own code with strongly typed arguments\n and outputs. Learn more about\n [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use\n custom tools to call your own code." }, "top_logprobs": { "type": [ "integer", "null" ], "format": "int32", "description": "An integer between 0 and 20 specifying the number of most likely tokens to return at each\ntoken position, each with an associated log probability.", "minimum": 0 }, "top_p": { "type": [ "number", "null" ], "format": "float", "description": "An alternative to sampling with temperature, called nucleus sampling,\nwhere the model considers the results of the tokens with top_p probability\nmass. So 0.1 means only the tokens comprising the top 10% probability mass\nare considered.\n\nWe generally recommend altering this or `temperature` but not both." }, "truncation": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Truncation", "description": "The truncation strategy to use for the model response.\n - `auto`: If the input to this Response exceeds\n the model's context window size, the model will truncate the\n response to fit the context window by dropping items from the beginning of the conversation.\n - `disabled` (default): If the input size will exceed the context window\n size for a model, the request will fail with a 400 error." } ] } } }, "CustomGrammarFormatParam": { "type": "object", "required": [ "definition", "syntax" ], "properties": { "definition": { "type": "string", "description": "The grammar definition." }, "syntax": { "$ref": "#/components/schemas/GrammarSyntax", "description": "The syntax of the grammar definition. One of `lark` or `regex`." } } }, "CustomName": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "The name of the custom tool to call." } } }, "CustomTool": { "type": "object", "required": [ "name", "input" ], "properties": { "input": { "type": "string", "description": "The input for the custom tool call generated by the model." }, "name": { "type": "string", "description": "The name of the custom tool to call." } } }, "CustomToolCall": { "type": "object", "required": [ "call_id", "input", "name", "id" ], "properties": { "call_id": { "type": "string", "description": "An identifier used to map this custom tool call to a tool call output." }, "id": { "type": "string", "description": "The unique ID of the custom tool call in the OpenAI platform." }, "input": { "type": "string", "description": "The input for the custom tool call generated by the model." }, "name": { "type": "string", "description": "The name of the custom tool being called." } } }, "CustomToolCallOutput": { "type": "object", "required": [ "call_id", "output" ], "properties": { "call_id": { "type": "string", "description": "The call ID, used to map this custom tool call output to a custom tool call." }, "id": { "type": [ "string", "null" ], "description": "The unique ID of the custom tool call output in the OpenAI platform." }, "output": { "$ref": "#/components/schemas/CustomToolCallOutputOutput", "description": "The output from the custom tool call generated by your code.\nCan be a string or an list of output content." } } }, "CustomToolCallOutputOutput": { "oneOf": [ { "type": "string", "description": "A string of the output of the custom tool call." }, { "type": "array", "items": { "$ref": "#/components/schemas/InputContent" }, "description": "Text, image, or file output of the custom tool call." } ] }, "CustomToolChatCompletions": { "type": "object", "required": [ "custom" ], "properties": { "custom": { "$ref": "#/components/schemas/CustomToolProperties" } } }, "CustomToolParam": { "type": "object", "required": [ "name", "format" ], "properties": { "description": { "type": [ "string", "null" ], "description": "Optional description of the custom tool, used to provide more context." }, "format": { "$ref": "#/components/schemas/CustomToolParamFormat", "description": "The input format for the custom tool. Default is unconstrained text." }, "name": { "type": "string", "description": "The name of the custom tool, used to identify it in tool calls." } } }, "CustomToolParamFormat": { "oneOf": [ { "type": "object", "description": "Unconstrained free-form text.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text" ] } } }, { "allOf": [ { "$ref": "#/components/schemas/CustomGrammarFormatParam", "description": "A grammar defined by the user." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "grammar" ] } } } ], "description": "A grammar defined by the user." } ] }, "CustomToolProperties": { "type": "object", "required": [ "name", "format" ], "properties": { "description": { "type": [ "string", "null" ], "description": "Optional description of the custom tool, used to provide more context." }, "format": { "$ref": "#/components/schemas/CustomToolPropertiesFormat", "description": "The input format for the custom tool. Default is unconstrained text." }, "name": { "type": "string", "description": "The name of the custom tool, used to identify it in tool calls." } } }, "CustomToolPropertiesFormat": { "oneOf": [ { "type": "object", "description": "Unconstrained free-form text.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text" ] } } }, { "type": "object", "description": "A grammar defined by the user.", "required": [ "grammar", "type" ], "properties": { "grammar": { "$ref": "#/components/schemas/CustomGrammarFormatParam" }, "type": { "type": "string", "enum": [ "grammar" ] } } } ] }, "DatasetFilter": { "type": "object", "properties": { "source": { "type": [ "string", "null" ], "description": "Filters datasets by source (e.g., `postgres:aidemo_messages`)." } } }, "DatasetInfo": { "type": "object", "description": "Dataset information returned by the `/v1/datasets` endpoint.", "required": [ "from", "name", "replication_enabled", "acceleration_enabled" ], "properties": { "acceleration_enabled": { "type": "boolean", "description": "Whether acceleration is enabled for the dataset" }, "error": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ComponentError", "description": "An optional error type/code for the dataset status.\nOnly populated when `status=true` and the dataset status is `Error`.\nExample:\n`{ \"category\": \"dataset\", \"type\": \"auth\", \"code\": \"dataset.auth\" }`." } ] }, "error_message": { "type": [ "string", "null" ], "description": "An optional error message describing why the dataset entered an error state.\nOnly populated when `status=true`, the dataset status is `Error`, and an error message was recorded.\nThis value is intended for user-visible display." }, "from": { "type": "string", "description": "The source where the dataset is located (e.g., `postgres:syncs`)" }, "name": { "type": "string", "description": "The name of the dataset" }, "properties": { "type": "object", "description": "Custom properties for the dataset", "additionalProperties": {}, "propertyNames": { "type": "string" } }, "replication_enabled": { "type": "boolean", "description": "Whether replication is enabled for the dataset" }, "status": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/String", "description": "The current status of the dataset. Only included when `status=true` query parameter is specified.\nPossible values: `Initializing`, `Ready`, `Disabled`, `Error`, `Refreshing`, `ShuttingDown`." } ] } } }, "DatasetQueryParams": { "type": "object", "properties": { "format": { "$ref": "#/components/schemas/Format", "description": "The format of the response. Possible values are 'json' (default) or 'csv'." }, "status": { "type": "boolean", "description": "Whether to include the status field in the response. When `true`, the response includes\nthe current status of each dataset (e.g., `ready`, `initializing`, `refreshing`, `error`).\nDefaults to `false`." } } }, "DoubleClickAction": { "type": "object", "description": "A double click action.", "required": [ "x", "y" ], "properties": { "x": { "type": "integer", "format": "int32", "description": "The x-coordinate where the double click occurred." }, "y": { "type": "integer", "format": "int32", "description": "The y-coordinate where the double click occurred." } } }, "Drag": { "type": "object", "description": "A drag action.", "required": [ "path" ], "properties": { "path": { "type": "array", "items": { "$ref": "#/components/schemas/DragPoint" }, "description": "The path of points the cursor drags through." } } }, "DragPoint": { "type": "object", "description": "A point in 2D space.", "required": [ "x", "y" ], "properties": { "x": { "type": "integer", "format": "int32", "description": "The x-coordinate." }, "y": { "type": "integer", "format": "int32", "description": "The y-coordinate." } } }, "EasyInputContent": { "oneOf": [ { "type": "string", "description": "A text input to the model." }, { "type": "array", "items": { "$ref": "#/components/schemas/InputContent" }, "description": "A list of one or many input items to the model, containing different content types." } ], "description": "Content for EasyInputMessage - can be a simple string or structured list." }, "EasyInputMessage": { "type": "object", "description": "A simplified message input to the model (EasyInputMessage in the OpenAPI spec).\n\nThis is the most user-friendly way to provide messages, supporting both simple\nstring content and structured content. Role can include `assistant` for providing\nprevious assistant responses.", "required": [ "role", "content" ], "properties": { "content": { "$ref": "#/components/schemas/EasyInputContent", "description": "Text, image, or audio input to the model, used to generate a response.\nCan also contain previous assistant responses." }, "role": { "$ref": "#/components/schemas/Role", "description": "The role of the message input. One of `user`, `assistant`, `system`, or `developer`." }, "type": { "$ref": "#/components/schemas/MessageType", "description": "The type of the message input. Always set to `message`." } } }, "Embedding": { "type": "object", "description": "Represents an embedding vector returned by embedding endpoint.", "required": [ "index", "object", "embedding" ], "properties": { "embedding": { "$ref": "#/components/schemas/EmbeddingVector", "description": "The embedding vector, which is a list of floats. The length of vector\ndepends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings)." }, "index": { "type": "integer", "format": "int32", "description": "The index of the embedding in the list of embeddings.", "minimum": 0 }, "object": { "type": "string", "description": "The object type, which is always \"embedding\"." } } }, "EmbeddingInput": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "integer", "format": "int32", "minimum": 0 } }, { "type": "array", "items": { "type": "array", "items": { "type": "integer", "format": "int32", "minimum": 0 } } } ] }, "EmbeddingUsage": { "type": "object", "required": [ "prompt_tokens", "total_tokens" ], "properties": { "prompt_tokens": { "type": "integer", "format": "int32", "description": "The number of tokens used by the prompt.", "minimum": 0 }, "total_tokens": { "type": "integer", "format": "int32", "description": "The total number of tokens used by the request.", "minimum": 0 } } }, "EmbeddingVector": { "oneOf": [ { "type": "array", "items": { "type": "number", "format": "float" } }, { "type": "string" } ] }, "EncodingFormat": { "type": "string", "enum": [ "float", "base64" ] }, "EntryType": { "oneOf": [ { "type": "string" }, { "type": "array", "items": {} }, { "type": "object", "additionalProperties": {}, "propertyNames": { "type": "string" } }, { "type": "null", "default": null } ], "description": "`TypeSafe` `EntryType`: string, object, array, or null.\n\nUsed for `instructions` and structured criteria descriptions.\nSee ." }, "ErrorObject": { "type": "object", "description": "Error returned by the API when a request fails.", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "description": "The error code for the response." }, "message": { "type": "string", "description": "A human-readable description of the error." } } }, "EvaluateRequest": { "type": "object", "description": "Request body for `POST /v1/evaluate` and provider System One calls.", "required": [ "model", "state", "questions" ], "properties": { "model": { "type": "string", "description": "Spicepod model name (runtime) or provider model id (provider forward)." }, "questions": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/Question" }, "minProperties": 1 }, "state": { "$ref": "#/components/schemas/EvaluateState", "description": "State for the model to evaluate: string, object, or array." } } }, "EvaluateResponse": { "type": "object", "description": "Response body for evaluation: typed answers plus provider metadata.", "required": [ "model", "answers" ], "properties": { "answers": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/Answer" }, "minProperties": 1 }, "model": { "type": "string", "description": "Versioned model id that answered (e.g. `jev-1.13.0`), when the provider reports it." }, "usage": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Usage" } ] } } }, "EvaluateState": { "oneOf": [ { "type": "string" }, { "type": "array", "items": {} }, { "type": "object", "additionalProperties": {}, "propertyNames": { "type": "string" } } ], "description": "Evaluation `state`: string, object, or array (not bool/number/null)." }, "FileCitationBody": { "type": "object", "required": [ "file_id", "filename", "index" ], "properties": { "file_id": { "type": "string", "description": "The ID of the file." }, "filename": { "type": "string", "description": "The filename of the file cited." }, "index": { "type": "integer", "format": "int32", "description": "The index of the file in the list of files.", "minimum": 0 } } }, "FileObject": { "type": "object", "properties": { "file_data": { "type": [ "string", "null" ], "description": "The base64 encoded file data, used when passing the file to the model\nas a string." }, "file_id": { "type": [ "string", "null" ], "description": "The ID of an uploaded file to use as input." }, "filename": { "type": [ "string", "null" ], "description": "The name of the file, used when passing the file to the model as a\nstring." } } }, "FilePath": { "type": "object", "required": [ "file_id", "index" ], "properties": { "file_id": { "type": "string", "description": "The ID of the file." }, "index": { "type": "integer", "format": "int32", "description": "The index of the file in the list of files.", "minimum": 0 } } }, "FileSearchTool": { "type": "object", "required": [ "vector_store_ids" ], "properties": { "filters": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Filter", "description": "A filter to apply." } ] }, "max_num_results": { "type": [ "integer", "null" ], "format": "int32", "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive.", "minimum": 0 }, "ranking_options": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/RankingOptions", "description": "Ranking options for search." } ] }, "vector_store_ids": { "type": "array", "items": { "type": "string" }, "description": "The IDs of the vector stores to search." } } }, "FileSearchToolCall": { "type": "object", "description": "File search tool call output.", "required": [ "id", "queries", "status" ], "properties": { "id": { "type": "string", "description": "The unique ID of the file search tool call." }, "queries": { "type": "array", "items": { "type": "string" }, "description": "The queries used to search for files." }, "results": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/FileSearchToolCallResult" }, "description": "The results of the file search tool call." }, "status": { "$ref": "#/components/schemas/FileSearchToolCallStatus", "description": "The status of the file search tool call. One of `in_progress`, `searching`,\n`incomplete`,`failed`, or `completed`." } } }, "FileSearchToolCallResult": { "type": "object", "description": "A single result from a file search.", "required": [ "attributes", "file_id", "filename", "score", "text" ], "properties": { "attributes": { "type": "object", "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing\nadditional information about the object in a structured format, and querying for objects\nAPI or the dashboard. Keys are strings with a maximum length of 64 characters\n. Values are strings with a maximum length of 512 characters, booleans, or numbers.", "additionalProperties": {}, "propertyNames": { "type": "string" } }, "file_id": { "type": "string", "description": "The unique ID of the file." }, "filename": { "type": "string", "description": "The name of the file." }, "score": { "type": "number", "format": "float", "description": "The relevance score of the file - a value between 0 and 1." }, "text": { "type": "string", "description": "The text that was retrieved from the file." } } }, "FileSearchToolCallStatus": { "type": "string", "enum": [ "in_progress", "searching", "incomplete", "failed", "completed" ] }, "Filter": { "oneOf": [ { "$ref": "#/components/schemas/ComparisonFilter", "description": "A filter used to compare a specified attribute key to a given value using a defined\ncomparison operation." }, { "$ref": "#/components/schemas/CompoundFilter", "description": "Combine multiple filters using `and` or `or`." } ], "description": "Filters for file search." }, "FinishReason": { "type": "string", "enum": [ "stop", "length", "tool_calls", "content_filter", "function_call" ] }, "Format": { "type": "string", "enum": [ "json", "csv" ] }, "FunctionCall": { "type": "object", "description": "The name and arguments of a function that should be called, as generated by the model.", "required": [ "name", "arguments" ], "properties": { "arguments": { "type": "string", "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function." }, "name": { "type": "string", "description": "The name of the function to call." } } }, "FunctionCallOutput": { "oneOf": [ { "type": "string", "description": "A JSON string of the output of the function tool call." }, { "type": "array", "items": { "$ref": "#/components/schemas/InputContent" } } ] }, "FunctionCallOutputItemParam": { "type": "object", "description": "Output from a function call that you're providing back to the model.", "required": [ "call_id", "output" ], "properties": { "call_id": { "type": "string", "description": "The unique ID of the function tool call generated by the model." }, "id": { "type": [ "string", "null" ], "description": "The unique ID of the function tool call output.\nPopulated when this item is returned via API." }, "output": { "$ref": "#/components/schemas/FunctionCallOutput", "description": "Text, image, or file output of the function tool call." }, "status": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/OutputStatus", "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API." } ] } } }, "FunctionName": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "The name of the function to call." } } }, "FunctionObject": { "type": "object", "required": [ "name" ], "properties": { "description": { "type": [ "string", "null" ], "description": "A description of what the function does, used by the model to choose when and how to call the function." }, "name": { "type": "string", "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64." }, "parameters": { "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list." }, "strict": { "type": [ "boolean", "null" ], "description": "Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling)." } } }, "FunctionShellAction": { "type": "object", "description": "Shell exec action\nExecute a shell command.", "required": [ "commands" ], "properties": { "commands": { "type": "array", "items": { "type": "string" }, "description": "A list of commands to run." }, "max_output_length": { "type": [ "integer", "null" ], "format": "int64", "description": "Optional maximum number of characters to return from each command.", "minimum": 0 }, "timeout_ms": { "type": [ "integer", "null" ], "format": "int64", "description": "Optional timeout in milliseconds for the commands.", "minimum": 0 } } }, "FunctionShellActionParam": { "type": "object", "description": "Commands and limits describing how to run the shell tool call.", "required": [ "commands" ], "properties": { "commands": { "type": "array", "items": { "type": "string" }, "description": "Ordered shell commands for the execution environment to run." }, "max_output_length": { "type": [ "integer", "null" ], "format": "int64", "description": "Maximum number of UTF-8 characters to capture from combined stdout and stderr output.", "minimum": 0 }, "timeout_ms": { "type": [ "integer", "null" ], "format": "int64", "description": "Maximum wall-clock time in milliseconds to allow the shell commands to run.", "minimum": 0 } } }, "FunctionShellCall": { "type": "object", "description": "A tool call that executes one or more shell commands in a managed environment.", "required": [ "id", "call_id", "action", "status" ], "properties": { "action": { "$ref": "#/components/schemas/FunctionShellAction", "description": "The shell commands and limits that describe how to run the tool call." }, "call_id": { "type": "string", "description": "The unique ID of the function shell tool call generated by the model." }, "created_by": { "type": [ "string", "null" ], "description": "The ID of the entity that created this tool call." }, "id": { "type": "string", "description": "The unique ID of the function shell tool call. Populated when this item is returned via API." }, "status": { "$ref": "#/components/schemas/LocalShellCallStatus", "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." } } }, "FunctionShellCallItemParam": { "type": "object", "description": "A tool representing a request to execute one or more shell commands.", "required": [ "call_id", "action" ], "properties": { "action": { "$ref": "#/components/schemas/FunctionShellActionParam", "description": "The shell commands and limits that describe how to run the tool call." }, "call_id": { "type": "string", "description": "The unique ID of the shell tool call generated by the model." }, "id": { "type": [ "string", "null" ], "description": "The unique ID of the shell tool call. Populated when this item is returned via API." }, "status": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/FunctionShellCallItemStatus", "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." } ] } } }, "FunctionShellCallItemStatus": { "type": "string", "description": "Status values reported for shell tool calls.", "enum": [ "in_progress", "completed", "incomplete" ] }, "FunctionShellCallOutput": { "type": "object", "description": "The output of a shell tool call.", "required": [ "id", "call_id", "output" ], "properties": { "call_id": { "type": "string", "description": "The unique ID of the shell tool call generated by the model." }, "created_by": { "type": [ "string", "null" ] }, "id": { "type": "string", "description": "The unique ID of the shell call output. Populated when this item is returned via API." }, "max_output_length": { "type": [ "integer", "null" ], "format": "int64", "description": "The maximum length of the shell command output. This is generated by the model and should be\npassed back with the raw output.", "minimum": 0 }, "output": { "type": "array", "items": { "$ref": "#/components/schemas/FunctionShellCallOutputContent" }, "description": "An array of shell call output contents" } } }, "FunctionShellCallOutputContent": { "allOf": [ { "$ref": "#/components/schemas/FunctionShellCallOutputOutcome", "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk." }, { "type": "object", "required": [ "stdout", "stderr" ], "properties": { "created_by": { "type": [ "string", "null" ] }, "stderr": { "type": "string" }, "stdout": { "type": "string" } } } ], "description": "The content of a shell call output." }, "FunctionShellCallOutputContentParam": { "type": "object", "description": "Captured stdout and stderr for a portion of a shell tool call output.", "required": [ "stdout", "stderr", "outcome" ], "properties": { "outcome": { "$ref": "#/components/schemas/FunctionShellCallOutputOutcomeParam", "description": "The exit or timeout outcome associated with this chunk." }, "stderr": { "type": "string", "description": "Captured stderr output for this chunk of the shell call." }, "stdout": { "type": "string", "description": "Captured stdout output for this chunk of the shell call." } } }, "FunctionShellCallOutputExitOutcome": { "type": "object", "description": "Indicates that the shell commands finished and returned an exit code.", "required": [ "exit_code" ], "properties": { "exit_code": { "type": "integer", "format": "int32", "description": "Exit code from the shell process." } } }, "FunctionShellCallOutputExitOutcomeParam": { "type": "object", "description": "Indicates that the shell commands finished and returned an exit code.", "required": [ "exit_code" ], "properties": { "exit_code": { "type": "integer", "format": "int32", "description": "The exit code returned by the shell process." } } }, "FunctionShellCallOutputItemParam": { "type": "object", "description": "The streamed output items emitted by a shell tool call.", "required": [ "call_id", "output" ], "properties": { "call_id": { "type": "string", "description": "The unique ID of the shell tool call generated by the model." }, "id": { "type": [ "string", "null" ], "description": "The unique ID of the shell tool call output. Populated when this item is returned via API." }, "max_output_length": { "type": [ "integer", "null" ], "format": "int64", "description": "The maximum number of UTF-8 characters captured for this shell call's combined output.", "minimum": 0 }, "output": { "type": "array", "items": { "$ref": "#/components/schemas/FunctionShellCallOutputContentParam" }, "description": "Captured chunks of stdout and stderr output, along with their associated outcomes." } } }, "FunctionShellCallOutputOutcome": { "oneOf": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "timeout" ] } } }, { "allOf": [ { "$ref": "#/components/schemas/FunctionShellCallOutputExitOutcome" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "exit" ] } } } ] } ], "description": "Function shell call outcome" }, "FunctionShellCallOutputOutcomeParam": { "oneOf": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "timeout" ] } } }, { "allOf": [ { "$ref": "#/components/schemas/FunctionShellCallOutputExitOutcomeParam" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "exit" ] } } } ] } ], "description": "The exit or timeout outcome associated with this chunk." }, "FunctionTool": { "type": "object", "required": [ "name" ], "properties": { "description": { "type": [ "string", "null" ], "description": "A description of the function. Used by the model to determine whether or not to call the\nfunction." }, "name": { "type": "string", "description": "The name of the function to call." }, "parameters": { "description": "A JSON schema object describing the parameters of the function." }, "strict": { "type": [ "boolean", "null" ], "description": "Whether to enforce strict parameter validation. Default `true`." } } }, "FunctionToolCall": { "type": "object", "required": [ "arguments", "call_id", "name" ], "properties": { "arguments": { "type": "string", "description": "A JSON string of the arguments to pass to the function." }, "call_id": { "type": "string", "description": "The unique ID of the function tool call generated by the model." }, "id": { "type": [ "string", "null" ], "description": "The unique ID of the function tool call." }, "name": { "type": "string", "description": "The name of the function to run." }, "status": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/OutputStatus", "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API." } ] } } }, "GeneratePackageRequest": { "type": "object", "required": [ "from", "params" ], "properties": { "from": { "type": "string", "description": "The GitHub source path in the format `github:{org}/{repo}/{sha}/{path_to_spicepod.yaml}`" }, "params": { "type": "object", "description": "A key-value map of optional parameters (e.g., `github_token`)", "additionalProperties": { "type": "string" }, "propertyNames": { "type": "string" } } } }, "GrammarSyntax": { "type": "string", "enum": [ "lark", "regex" ] }, "HybridSearch": { "type": "object", "required": [ "embedding_weight", "text_weight" ], "properties": { "embedding_weight": { "type": "number", "format": "float", "description": "The weight of the embedding in the reciprocal ranking fusion." }, "text_weight": { "type": "number", "format": "float", "description": "The weight of the text in the reciprocal ranking fusion." } } }, "IcebergError": { "type": "object", "required": [ "message", "type", "code" ], "properties": { "code": { "type": "integer", "format": "int32", "minimum": 0 }, "message": { "type": "string" }, "type": { "$ref": "#/components/schemas/IcebergErrorType" } } }, "IcebergErrorType": { "type": "string", "enum": [ "NoSuchNamespaceException", "BadRequestException", "InternalServerError" ] }, "IcebergResponseError": { "type": "object", "required": [ "error" ], "properties": { "error": { "$ref": "#/components/schemas/IcebergError" } } }, "ImageDetail": { "type": "string", "enum": [ "auto", "low", "high" ] }, "ImageGenTool": { "type": "object", "description": "Image generation tool definition.", "properties": { "background": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ImageGenToolBackground", "description": "Background type for the generated image. One of `transparent`,\n`opaque`, or `auto`. Default: `auto`." } ] }, "input_fidelity": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/InputFidelity", "description": "Control how much effort the model will exert to match the style and features, especially facial features,\nof input images. This parameter is only supported for `gpt-image-1`. Unsupported\nfor `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`." } ] }, "input_image_mask": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ImageGenToolInputImageMask", "description": "Optional mask for inpainting. Contains `image_url`\n(string, optional) and `file_id` (string, optional)." } ] }, "model": { "type": [ "string", "null" ], "description": "The image generation model to use. Default: `gpt-image-1`." }, "moderation": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ImageGenToolModeration", "description": "Moderation level for the generated image. Default: `auto`." } ] }, "output_compression": { "type": [ "integer", "null" ], "format": "int32", "description": "Compression level for the output image. Default: 100.", "minimum": 0 }, "output_format": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ImageGenToolOutputFormat", "description": "The output format of the generated image. One of `png`, `webp`, or\n`jpeg`. Default: `png`." } ] }, "partial_images": { "type": [ "integer", "null" ], "format": "int32", "description": "Number of partial images to generate in streaming mode, from 0 (default value) to 3.", "minimum": 0 }, "quality": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ImageGenToolQuality", "description": "The quality of the generated image. One of `low`, `medium`, `high`,\nor `auto`. Default: `auto`." } ] }, "size": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ImageGenToolSize", "description": "The size of the generated image. One of `1024x1024`, `1024x1536`,\n`1536x1024`, or `auto`. Default: `auto`." } ] } } }, "ImageGenToolBackground": { "type": "string", "enum": [ "transparent", "opaque", "auto" ] }, "ImageGenToolCall": { "type": "object", "required": [ "id", "status" ], "properties": { "id": { "type": "string", "description": "The unique ID of the image generation call." }, "result": { "type": [ "string", "null" ], "description": "The generated image encoded in base64." }, "status": { "$ref": "#/components/schemas/ImageGenToolCallStatus", "description": "The status of the image generation call." } } }, "ImageGenToolCallStatus": { "type": "string", "enum": [ "in_progress", "completed", "generating", "failed" ] }, "ImageGenToolInputImageMask": { "type": "object", "properties": { "file_id": { "type": [ "string", "null" ], "description": "File ID for the mask image." }, "image_url": { "type": [ "string", "null" ], "description": "Base64-encoded mask image." } } }, "ImageGenToolModeration": { "type": "string", "enum": [ "auto", "low" ] }, "ImageGenToolOutputFormat": { "type": "string", "enum": [ "png", "webp", "jpeg" ] }, "ImageGenToolQuality": { "type": "string", "enum": [ "low", "medium", "high", "auto" ] }, "ImageGenToolSize": { "type": "string", "enum": [ "auto", "1024x1024", "1024x1536", "1536x1024" ] }, "ImageUrl": { "type": "object", "required": [ "url" ], "properties": { "detail": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ImageDetail", "description": "Specifies the detail level of the image. Learn more in the [Vision guide](https://platform.openai.com/docs/guides/vision/low-or-high-fidelity-image-understanding)." } ] }, "url": { "type": "string", "description": "Either a URL of the image or the base64 encoded image data." } } }, "IncludeEnum": { "type": "string", "enum": [ "file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs" ] }, "IncompleteDetails": { "type": "object", "description": "Details about an incomplete response.", "required": [ "reason" ], "properties": { "reason": { "type": "string", "description": "The reason why the response is incomplete." } } }, "InputAudio": { "type": "object", "required": [ "data", "format" ], "properties": { "data": { "type": "string", "description": "Base64 encoded audio data." }, "format": { "$ref": "#/components/schemas/InputAudioFormat", "description": "The format of the encoded audio data. Currently supports \"wav\" and \"mp3\"." } } }, "InputAudioFormat": { "type": "string", "enum": [ "wav", "mp3" ] }, "InputContent": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/InputTextContent", "description": "A text input to the model." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text" ] } } } ], "description": "A text input to the model." }, { "allOf": [ { "$ref": "#/components/schemas/InputImageContent", "description": "An image input to the model. Learn about\n[image inputs](https://platform.openai.com/docs/guides/vision)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_image" ] } } } ], "description": "An image input to the model. Learn about\n[image inputs](https://platform.openai.com/docs/guides/vision)." }, { "allOf": [ { "$ref": "#/components/schemas/InputFileContent", "description": "A file input to the model." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_file" ] } } } ], "description": "A file input to the model." } ], "description": "Parts of a message: text, image, file, or audio." }, "InputFidelity": { "type": "string", "enum": [ "high", "low" ] }, "InputFileContent": { "type": "object", "properties": { "file_data": { "type": [ "string", "null" ], "description": "The content of the file to be sent to the model." }, "file_id": { "type": [ "string", "null" ], "description": "The ID of the file to be sent to the model." }, "file_url": { "type": [ "string", "null" ], "description": "The URL of the file to be sent to the model." }, "filename": { "type": [ "string", "null" ], "description": "The name of the file to be sent to the model." } } }, "InputImageContent": { "type": "object", "required": [ "detail" ], "properties": { "detail": { "$ref": "#/components/schemas/ImageDetail", "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`.\nDefaults to `auto`." }, "file_id": { "type": [ "string", "null" ], "description": "The ID of the file to be sent to the model." }, "image_url": { "type": [ "string", "null" ], "description": "The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image\nin a data URL." } } }, "InputItem": { "oneOf": [ { "$ref": "#/components/schemas/ItemReference", "description": "A reference to an existing item by ID.\nHas a required `id` field and optional `type` (can be \"item_reference\" or null).\nMust be tried first as it's the most minimal structure." }, { "$ref": "#/components/schemas/Item", "description": "All structured items with proper type discrimination.\nIncludes InputMessage, OutputMessage, and all tool calls/outputs.\nUses the discriminated `Item` enum for efficient, type-safe deserialization." }, { "$ref": "#/components/schemas/EasyInputMessage", "description": "A simple, user-friendly message input (EasyInputMessage).\nSupports string content and can include assistant role for previous responses.\nMust be tried last as it's the most flexible structure.\n\nA message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions." } ], "description": "Input item that can be used in the context for generating a response.\n\nThis represents the OpenAPI `InputItem` schema which is an `anyOf`:\n1. `EasyInputMessage` - Simple, user-friendly message input (can use string content)\n2. `Item` - Structured items with proper type discrimination (including InputMessage, OutputMessage, tool calls)\n3. `ItemReferenceParam` - Reference to an existing item by ID (type can be null)\n\nUses untagged deserialization because these types overlap in structure.\nOrder matters: more specific structures are tried first.\n\n# OpenAPI Specification\nCorresponds to the `InputItem` schema: `anyOf[EasyInputMessage, Item, ItemReferenceParam]`" }, "InputMessage": { "type": "object", "description": "A structured message input to the model (InputMessage in the OpenAPI spec).\n\nThis variant requires structured content (not a simple string) and does not support\nthe `assistant` role (use OutputMessage for that). status is populated when items are returned via API.", "required": [ "content", "role" ], "properties": { "content": { "type": "array", "items": { "$ref": "#/components/schemas/InputContent" }, "description": "A list of one or many input items to the model, containing different content types." }, "role": { "$ref": "#/components/schemas/InputRole", "description": "The role of the message input. One of `user`, `system`, or `developer`.\nNote: `assistant` is NOT allowed here; use OutputMessage instead." }, "status": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/OutputStatus", "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API." } ] } } }, "InputParam": { "oneOf": [ { "type": "string", "description": " A text input to the model, equivalent to a text input with the\n`user` role." }, { "type": "array", "items": { "$ref": "#/components/schemas/InputItem" }, "description": "A list of one or many input items to the model, containing\ndifferent content types." } ] }, "InputRole": { "type": "string", "description": "The role for an input message - can only be `user`, `system`, or `developer`.\nThis type ensures type safety by excluding the `assistant` role (use OutputMessage for that).", "enum": [ "user", "system", "developer" ] }, "InputTextContent": { "type": "object", "required": [ "text" ], "properties": { "text": { "type": "string", "description": "The text input to the model." } } }, "InputTokenDetails": { "type": "object", "required": [ "cached_tokens" ], "properties": { "cached_tokens": { "type": "integer", "format": "int32", "description": "The number of tokens that were retrieved from the cache.\n[More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).", "minimum": 0 } } }, "Instructions": { "oneOf": [ { "type": "string", "description": "A text input to the model, equivalent to a text input with the `developer` role." }, { "type": "array", "items": { "$ref": "#/components/schemas/InputItem" }, "description": "A list of one or many input items to the model, containing different content types." } ] }, "Item": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/MessageItem", "description": "A message (type: \"message\").\nCan represent InputMessage (user/system/developer) or OutputMessage (assistant).\n\nInputMessage:\n A message input to the model with a role indicating instruction following hierarchy.\n Instructions given with the developer or system role take precedence over instructions given with the user role.\nOutputMessage:\n A message output from the model." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "message" ] } } } ], "description": "A message (type: \"message\").\nCan represent InputMessage (user/system/developer) or OutputMessage (assistant).\n\nInputMessage:\n A message input to the model with a role indicating instruction following hierarchy.\n Instructions given with the developer or system role take precedence over instructions given with the user role.\nOutputMessage:\n A message output from the model." }, { "allOf": [ { "$ref": "#/components/schemas/FileSearchToolCall", "description": "The results of a file search tool call. See the\n[file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "file_search_call" ] } } } ], "description": "The results of a file search tool call. See the\n[file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information." }, { "allOf": [ { "$ref": "#/components/schemas/ComputerToolCall", "description": "A tool call to a computer use tool. See the\n[computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "computer_call" ] } } } ], "description": "A tool call to a computer use tool. See the\n[computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information." }, { "allOf": [ { "$ref": "#/components/schemas/ComputerCallOutputItemParam", "description": "The output of a computer tool call." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "computer_call_output" ] } } } ], "description": "The output of a computer tool call." }, { "allOf": [ { "$ref": "#/components/schemas/WebSearchToolCall", "description": "The results of a web search tool call. See the\n[web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "web_search_call" ] } } } ], "description": "The results of a web search tool call. See the\n[web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information." }, { "allOf": [ { "$ref": "#/components/schemas/FunctionToolCall", "description": "A tool call to run a function. See the\n\n[function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function_call" ] } } } ], "description": "A tool call to run a function. See the\n\n[function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information." }, { "allOf": [ { "$ref": "#/components/schemas/FunctionCallOutputItemParam", "description": "The output of a function tool call." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function_call_output" ] } } } ], "description": "The output of a function tool call." }, { "allOf": [ { "$ref": "#/components/schemas/ReasoningItem", "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](https://platform.openai.com/docs/guides/conversation-state)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "reasoning" ] } } } ], "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](https://platform.openai.com/docs/guides/conversation-state)." }, { "allOf": [ { "$ref": "#/components/schemas/CompactionSummaryItemParam", "description": "A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "compaction" ] } } } ], "description": "A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact)." }, { "allOf": [ { "$ref": "#/components/schemas/ImageGenToolCall", "description": "An image generation request made by the model." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "image_generation_call" ] } } } ], "description": "An image generation request made by the model." }, { "allOf": [ { "$ref": "#/components/schemas/CodeInterpreterToolCall", "description": "A tool call to run code." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "code_interpreter_call" ] } } } ], "description": "A tool call to run code." }, { "allOf": [ { "$ref": "#/components/schemas/LocalShellToolCall", "description": "A tool call to run a command on the local shell." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "local_shell_call" ] } } } ], "description": "A tool call to run a command on the local shell." }, { "allOf": [ { "$ref": "#/components/schemas/LocalShellToolCallOutput", "description": "The output of a local shell tool call." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "local_shell_call_output" ] } } } ], "description": "The output of a local shell tool call." }, { "allOf": [ { "$ref": "#/components/schemas/FunctionShellCallItemParam", "description": "A tool representing a request to execute one or more shell commands." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "shell_call" ] } } } ], "description": "A tool representing a request to execute one or more shell commands." }, { "allOf": [ { "$ref": "#/components/schemas/FunctionShellCallOutputItemParam", "description": "The streamed output items emitted by a shell tool call." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "shell_call_output" ] } } } ], "description": "The streamed output items emitted by a shell tool call." }, { "allOf": [ { "$ref": "#/components/schemas/ApplyPatchToolCallItemParam", "description": "A tool call representing a request to create, delete, or update files using diff patches." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "apply_patch_call" ] } } } ], "description": "A tool call representing a request to create, delete, or update files using diff patches." }, { "allOf": [ { "$ref": "#/components/schemas/ApplyPatchToolCallOutputItemParam", "description": "The streamed output emitted by an apply patch tool call." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "apply_patch_call_output" ] } } } ], "description": "The streamed output emitted by an apply patch tool call." }, { "allOf": [ { "$ref": "#/components/schemas/MCPListTools", "description": "A list of tools available on an MCP server." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "mcp_list_tools" ] } } } ], "description": "A list of tools available on an MCP server." }, { "allOf": [ { "$ref": "#/components/schemas/MCPApprovalRequest", "description": "A request for human approval of a tool invocation." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "mcp_approval_request" ] } } } ], "description": "A request for human approval of a tool invocation." }, { "allOf": [ { "$ref": "#/components/schemas/MCPApprovalResponse", "description": "A response to an MCP approval request." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "mcp_approval_response" ] } } } ], "description": "A response to an MCP approval request." }, { "allOf": [ { "$ref": "#/components/schemas/MCPToolCall", "description": "An invocation of a tool on an MCP server." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "mcp_call" ] } } } ], "description": "An invocation of a tool on an MCP server." }, { "allOf": [ { "$ref": "#/components/schemas/CustomToolCallOutput", "description": "The output of a custom tool call from your code, being sent back to the model." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "custom_tool_call_output" ] } } } ], "description": "The output of a custom tool call from your code, being sent back to the model." }, { "allOf": [ { "$ref": "#/components/schemas/CustomToolCall", "description": "A call to a custom tool created by the model." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "custom_tool_call" ] } } } ], "description": "A call to a custom tool created by the model." } ], "description": "Content item used to generate a response.\n\nThis is a properly discriminated union based on the `type` field, using Rust's\ntype-safe enum with serde's tag attribute for efficient deserialization.\n\n# OpenAPI Specification\nCorresponds to the `Item` schema in the OpenAPI spec with a `type` discriminator." }, "ItemReference": { "type": "object", "description": "A reference to an existing item by ID.", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "The ID of the item to reference." }, "type": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ItemReferenceType", "description": "The type of item to reference. Can be \"item_reference\" or null." } ] } } }, "ItemReferenceType": { "type": "string", "enum": [ "item_reference" ] }, "KeyPressAction": { "type": "object", "description": "A keypress action.", "required": [ "keys" ], "properties": { "keys": { "type": "array", "items": { "type": "string" }, "description": "The combination of keys the model is requesting to be pressed.\nThis is an array of strings, each representing a key." } } }, "ListTablesResponse": { "type": "object", "required": [ "identifiers" ], "properties": { "identifiers": { "type": "array", "items": { "$ref": "#/components/schemas/TableIdentifier" } } } }, "ListToolElement": { "type": "object", "description": "Summary of a tool available to run, and the schema of its input parameters.", "required": [ "name" ], "properties": { "description": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "parameters": {} } }, "LoadTableResponse": { "type": "object", "required": [ "metadata" ], "properties": { "metadata": { "$ref": "#/components/schemas/TableMetadata" } } }, "LocalShellCallStatus": { "type": "string", "description": "Status values reported for function shell tool calls.", "enum": [ "in_progress", "completed", "incomplete" ] }, "LocalShellExecAction": { "type": "object", "description": "Define the shape of a local shell action (exec).", "required": [ "command", "env" ], "properties": { "command": { "type": "array", "items": { "type": "string" }, "description": "The command to run." }, "env": { "type": "object", "description": "Environment variables to set for the command.", "additionalProperties": { "type": "string" }, "propertyNames": { "type": "string" } }, "timeout_ms": { "type": [ "integer", "null" ], "format": "int64", "description": "Optional timeout in milliseconds for the command.", "minimum": 0 }, "user": { "type": [ "string", "null" ], "description": "Optional user to run the command as." }, "working_directory": { "type": [ "string", "null" ], "description": "Optional working directory to run the command in." } } }, "LocalShellToolCall": { "type": "object", "required": [ "action", "call_id", "id", "status" ], "properties": { "action": { "$ref": "#/components/schemas/LocalShellExecAction", "description": "Execute a shell command on the server." }, "call_id": { "type": "string", "description": "The unique ID of the local shell tool call generated by the model." }, "id": { "type": "string", "description": "The unique ID of the local shell call." }, "status": { "$ref": "#/components/schemas/OutputStatus", "description": "The status of the local shell call." } } }, "LocalShellToolCallOutput": { "type": "object", "description": "Output from a local shell tool call that you're providing back to the model.", "required": [ "id", "output" ], "properties": { "id": { "type": "string", "description": "The unique ID of the local shell tool call generated by the model." }, "output": { "type": "string", "description": "A JSON string of the output of the local shell tool call." }, "status": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/OutputStatus", "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`." } ] } } }, "LogProb": { "type": "object", "required": [ "bytes", "logprob", "token", "top_logprobs" ], "properties": { "bytes": { "type": "array", "items": { "type": "integer", "format": "int32", "minimum": 0 } }, "logprob": { "type": "number", "format": "double" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "$ref": "#/components/schemas/TopLogProb" } } } }, "MCPApprovalRequest": { "type": "object", "required": [ "arguments", "id", "name", "server_label" ], "properties": { "arguments": { "type": "string", "description": "JSON string of arguments for the tool." }, "id": { "type": "string", "description": "The unique ID of the approval request." }, "name": { "type": "string", "description": "The name of the tool to run." }, "server_label": { "type": "string", "description": "The label of the MCP server making the request." } } }, "MCPApprovalResponse": { "type": "object", "description": "An MCP approval response that you're providing back to the model.", "required": [ "approval_request_id", "approve" ], "properties": { "approval_request_id": { "type": "string", "description": "The ID of the approval request being answered." }, "approve": { "type": "boolean", "description": "Whether the request was approved." }, "id": { "type": [ "string", "null" ], "description": "The unique ID of the approval response" }, "reason": { "type": [ "string", "null" ], "description": "Optional reason for the decision." } } }, "MCPListTools": { "type": "object", "required": [ "id", "server_label", "tools" ], "properties": { "error": { "type": [ "string", "null" ], "description": "Error message if listing failed." }, "id": { "type": "string", "description": "The unique ID of the list." }, "server_label": { "type": "string", "description": "The label of the MCP server." }, "tools": { "type": "array", "items": { "$ref": "#/components/schemas/MCPListToolsTool" }, "description": "The tools available on the server." } } }, "MCPListToolsTool": { "type": "object", "required": [ "input_schema", "name" ], "properties": { "annotations": { "description": "Additional annotations about the tool." }, "description": { "type": [ "string", "null" ], "description": "The description of the tool." }, "input_schema": { "description": "The JSON schema describing the tool's input." }, "name": { "type": "string", "description": "The name of the tool." } } }, "MCPTool": { "type": "object", "required": [ "server_label" ], "properties": { "allowed_tools": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MCPToolAllowedTools", "description": "List of allowed tool names or a filter object." } ] }, "authorization": { "type": [ "string", "null" ], "description": "An OAuth access token that can be used with a remote MCP server, either with a custom MCP\nserver URL or a service connector. Your application must handle the OAuth authorization\nflow and provide the token here." }, "connector_id": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/McpToolConnectorId", "description": "Identifier for service connectors, like those available in ChatGPT. One of `server_url` or\n`connector_id` must be provided. Learn more about service connectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).\n\nCurrently supported `connector_id` values are:\n- Dropbox: `connector_dropbox`\n- Gmail: `connector_gmail`\n- Google Calendar: `connector_googlecalendar`\n- Google Drive: `connector_googledrive`\n- Microsoft Teams: `connector_microsoftteams`\n- Outlook Calendar: `connector_outlookcalendar`\n- Outlook Email: `connector_outlookemail`\n- SharePoint: `connector_sharepoint`" } ] }, "headers": { "description": "Optional HTTP headers to send to the MCP server. Use for authentication or other purposes." }, "require_approval": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MCPToolRequireApproval", "description": "Specify which of the MCP server's tools require approval." } ] }, "server_description": { "type": [ "string", "null" ], "description": "Optional description of the MCP server, used to provide more context." }, "server_label": { "type": "string", "description": "A label for this MCP server, used to identify it in tool calls." }, "server_url": { "type": [ "string", "null" ], "description": "The URL for the MCP server. One of `server_url` or `connector_id` must be provided." } } }, "MCPToolAllowedTools": { "oneOf": [ { "type": "array", "items": { "type": "string" }, "description": "A string array of allowed tool names" }, { "$ref": "#/components/schemas/MCPToolFilter", "description": "A filter object to specify which tools are allowed." } ] }, "MCPToolApprovalFilter": { "type": "object", "properties": { "always": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MCPToolFilter", "description": "A list of tools that always require approval." } ] }, "never": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MCPToolFilter", "description": "A list of tools that never require approval." } ] } } }, "MCPToolApprovalSetting": { "type": "string", "enum": [ "always", "never" ] }, "MCPToolCall": { "type": "object", "description": "Output of an MCP server tool invocation.", "required": [ "arguments", "id", "name", "server_label" ], "properties": { "approval_request_id": { "type": [ "string", "null" ], "description": "Unique identifier for the MCP tool call approval request. Include this value\nin a subsequent `mcp_approval_response` input to approve or reject the corresponding\ntool call." }, "arguments": { "type": "string", "description": "A JSON string of the arguments passed to the tool." }, "error": { "type": [ "string", "null" ], "description": "Error message from the call, if any." }, "id": { "type": "string", "description": "The unique ID of the tool call." }, "name": { "type": "string", "description": "The name of the tool that was run." }, "output": { "type": [ "string", "null" ], "description": "The output from the tool call." }, "server_label": { "type": "string", "description": "The label of the MCP server running the tool." }, "status": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/MCPToolCallStatus", "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`,\n`calling`, or `failed`." } ] } } }, "MCPToolCallStatus": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "calling", "failed" ] }, "MCPToolFilter": { "type": "object", "properties": { "read_only": { "type": [ "boolean", "null" ], "description": "Indicates whether or not a tool modifies data or is read-only.\nIf an MCP server is annotated with [readOnlyHint](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),\nit will match this filter." }, "tool_names": { "type": [ "array", "null" ], "items": { "type": "string" }, "description": "List of allowed tool names." } } }, "MCPToolRequireApproval": { "oneOf": [ { "$ref": "#/components/schemas/MCPToolApprovalFilter", "description": "Specify which of the MCP server's tools require approval. Can be\n`always`, `never`, or a filter object associated with tools\nthat require approval." }, { "$ref": "#/components/schemas/MCPToolApprovalSetting", "description": "Specify a single approval policy for all tools. One of `always` or\n`never`. When set to `always`, all tools will require approval. When\nset to `never`, all tools will not require approval." } ], "description": "Approval policy or filter for MCP tools." }, "Match": { "type": "object", "required": [ "matches", "_score", "dataset" ], "properties": { "_score": { "type": "number", "format": "double", "description": "The similarity of the match to the query" }, "data": { "type": "object", "description": "Addditional data from the `dataset` requested by the user.", "additionalProperties": {}, "propertyNames": { "type": "string" } }, "dataset": { "type": "string", "description": "The name of the dataset where the match was found" }, "matches": { "type": "object", "description": "The matches for this result", "additionalProperties": { "type": "array", "items": {} }, "propertyNames": { "type": "string" } }, "metadata": { "type": "object", "additionalProperties": {}, "propertyNames": { "type": "string" } }, "primary_key": { "type": "object", "description": "Primary key(s) identifying the matched item in the dataset", "additionalProperties": {}, "propertyNames": { "type": "string" } } } }, "McpToolConnectorId": { "type": "string", "enum": [ "connector_dropbox", "connector_gmail", "connector_googlecalendar", "connector_googledrive", "connector_microsoftteams", "connector_outlookcalendar", "connector_outlookemail", "connector_sharepoint" ] }, "MessageItem": { "oneOf": [ { "$ref": "#/components/schemas/OutputMessage", "description": "An output message from the model (role: assistant, has required id & status).\nThis must come first as it has the most specific structure (required id and status fields)." }, { "$ref": "#/components/schemas/InputMessage", "description": "A structured input message (role: user/system/developer, content is `Vec`).\nHas structured content list and optional id/status fields.\n\nA message input to the model with a role indicating instruction following hierarchy.\nInstructions given with the `developer` or `system` role take precedence over instructions\ngiven with the `user` role." } ], "description": "A message item used within the `Item` enum.\n\nBoth InputMessage and OutputMessage have `type: \"message\"`, so we use an untagged\nenum to distinguish them based on their structure:\n- OutputMessage: role=assistant, required id & status fields\n- InputMessage: role=user/system/developer, content is `Vec`, optional id/status\n\nNote: EasyInputMessage is NOT included here - it's a separate variant in `InputItem`,\nnot part of the structured `Item` enum." }, "MessageResponse": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string", "description": "The message describing the result of the request" } } }, "MessageType": { "type": "string", "enum": [ "message" ] }, "Metadata": { "description": "Set of 16 key-value pairs that can be attached to an object.\nThis can be useful for storing additional information about the\nobject in a structured format, and querying for objects via API\nor the dashboard. Keys are strings with a maximum length of 64\ncharacters. Values are strings with a maximum length of 512\ncharacters." }, "ModelInfo": { "type": "object", "description": "Model information returned in the `/v1/models` response (OpenAI-compatible format).", "required": [ "id", "object", "owned_by" ], "properties": { "datasets": { "type": [ "array", "null" ], "items": { "type": "string" }, "description": "The datasets associated with this model, if any" }, "error": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ComponentError", "description": "An optional error type/code for the model status.\nOnly populated when `status=true` and the model status is `Error`.\nExample:\n`{ \"category\": \"model\", \"type\": \"auth\", \"code\": \"model.auth\" }`." } ] }, "error_message": { "type": [ "string", "null" ], "description": "An optional error message describing why the model entered an error state.\nOnly populated when `status=true`, the model status is `Error`, and an error message was recorded.\nThis value is intended for user-visible display." }, "id": { "type": "string", "description": "The name/identifier of the model" }, "metadata": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ModelMetadata", "description": "Optional metadata fields, included when requested via query parameters" } ] }, "object": { "type": "string", "description": "The type of the object (always `model`)" }, "owned_by": { "type": "string", "description": "The source from which the model was loaded (e.g., `openai`, `spiceai`)" }, "status": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/String", "description": "The status of the model (e.g., `Ready`, `Initializing`, `Error`)" } ] } } }, "ModelListResponse": { "type": "object", "description": "Response wrapper for the `/v1/models` endpoint (OpenAI-compatible format).", "required": [ "object", "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ModelInfo" }, "description": "The list of models" }, "object": { "type": "string", "description": "The type of the response (always `list`)" } } }, "ModelMetadata": { "type": "object", "description": "Model metadata fields that can be optionally requested.", "required": [ "supports_responses_api" ], "properties": { "supports_responses_api": { "type": "boolean", "description": "Whether this model supports the Responses API" } } }, "Move": { "type": "object", "description": "A mouse move action.", "required": [ "x", "y" ], "properties": { "x": { "type": "integer", "format": "int32", "description": "The x-coordinate to move to." }, "y": { "type": "integer", "format": "int32", "description": "The y-coordinate to move to." } } }, "Namespace": { "type": "object", "required": [ "parts" ], "properties": { "parts": { "type": "array", "items": { "type": "string" } } } }, "NamespacesResponse": { "type": "object", "required": [ "namespaces" ], "properties": { "namespaces": { "type": "array", "items": { "$ref": "#/components/schemas/Namespace" } } } }, "NonNullEntry": { "oneOf": [ { "type": "string" }, { "type": "array", "items": {} }, { "type": "object", "additionalProperties": {}, "propertyNames": { "type": "string" } } ], "description": "Non-null `EntryType` values: string, object, or array (not JSON null).\n\nUsed for score rubric levels so the `OpenAPI` contract matches `TypeSafe`'s\nnon-empty `list[str | object | array]` criteria shape." }, "NoulCriteria": { "type": "object", "description": "Optional yes/no rubric for a noul question.\n\n`true` / `false` use [`NullableEntry`] so explicit JSON `null` is preserved when\nforwarding to `TypeSafe` (unlike `Option`, which drops nulls).", "properties": { "false": { "$ref": "#/components/schemas/NullableEntry" }, "true": { "$ref": "#/components/schemas/NullableEntry" } } }, "NsqlColumnContext": { "type": "object", "required": [ "name", "data_type", "nullable", "metadata", "primary_key", "unique", "indexed", "vector_search", "full_text_search" ], "properties": { "data_type": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "full_text_search": { "type": "boolean" }, "indexed": { "type": "boolean" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "propertyNames": { "type": "string" } }, "name": { "type": "string" }, "nullable": { "type": "boolean" }, "primary_key": { "type": "boolean" }, "source_type": { "type": [ "string", "null" ] }, "unique": { "type": "boolean" }, "vector_search": { "type": "boolean" } } }, "NsqlContextJsonResponse": { "type": "object", "required": [ "context", "instructions", "sql", "datasets", "functions", "samples" ], "properties": { "context": { "type": "string", "description": "The rendered NSQL context block injected into `/v1/nsql` model requests." }, "datasets": { "type": "array", "items": { "$ref": "#/components/schemas/NsqlDatasetContext" }, "description": "In-scope datasets with schema, metadata, relationship, key, and index details." }, "functions": { "$ref": "#/components/schemas/NsqlFunctionContext", "description": "Available function groups filtered to the current `DataFusion` context." }, "instructions": { "type": "array", "items": { "type": "string" }, "description": "High-level SQL generation instructions." }, "samples": { "type": "array", "items": { "$ref": "#/components/schemas/SampleContextBlock" }, "description": "Optional sample blocks included when requested." }, "sql": { "$ref": "#/components/schemas/NsqlSqlContext", "description": "SQL engine and dialect details for Spice SQL." } } }, "NsqlDatasetContext": { "type": "object", "required": [ "name", "table", "metadata", "columns", "primary_key", "unique_constraints", "foreign_keys", "indexes", "search" ], "properties": { "catalog": { "type": [ "string", "null" ] }, "columns": { "type": "array", "items": { "$ref": "#/components/schemas/NsqlColumnContext" } }, "description": { "type": [ "string", "null" ] }, "foreign_keys": { "type": "array", "items": { "$ref": "#/components/schemas/NsqlForeignKeyContext" } }, "indexes": { "type": "array", "items": { "$ref": "#/components/schemas/NsqlIndexContext" } }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "propertyNames": { "type": "string" } }, "name": { "type": "string" }, "primary_key": { "type": "array", "items": { "type": "string" } }, "schema": { "type": [ "string", "null" ] }, "search": { "$ref": "#/components/schemas/NsqlDatasetSearchContext" }, "table": { "type": "string" }, "unique_constraints": { "type": "array", "items": { "type": "array", "items": { "type": "string" } } } } }, "NsqlDatasetSearchContext": { "type": "object", "required": [ "vector", "full_text" ], "properties": { "full_text": { "type": "array", "items": { "$ref": "#/components/schemas/NsqlFullTextSearchContext" } }, "vector": { "type": "array", "items": { "$ref": "#/components/schemas/NsqlVectorSearchContext" } } } }, "NsqlForeignKeyContext": { "type": "object", "required": [ "columns", "foreign_table", "foreign_columns" ], "properties": { "columns": { "type": "array", "items": { "type": "string" } }, "foreign_columns": { "type": "array", "items": { "type": "string" } }, "foreign_table": { "type": "string" } } }, "NsqlFullTextSearchContext": { "type": "object", "required": [ "column", "function", "syntax", "engine", "index_store", "row_id_columns", "required_columns", "notes" ], "properties": { "column": { "type": "string" }, "engine": { "type": "string" }, "function": { "type": "string" }, "index": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/NsqlIndexContext" } ] }, "index_store": { "type": "string" }, "notes": { "type": "array", "items": { "type": "string" } }, "required_columns": { "type": "array", "items": { "type": "string" } }, "row_id_columns": { "type": "array", "items": { "type": "string" } }, "syntax": { "type": "string" } } }, "NsqlFunctionContext": { "type": "object", "required": [ "summary", "json", "search", "additional", "spark_compatibility", "user_defined" ], "properties": { "additional": { "type": "array", "items": { "$ref": "#/components/schemas/NsqlFunctionContextEntry" } }, "json": { "type": "array", "items": { "$ref": "#/components/schemas/NsqlFunctionContextEntry" } }, "search": { "type": "array", "items": { "$ref": "#/components/schemas/NsqlFunctionContextEntry" } }, "spark_compatibility": { "$ref": "#/components/schemas/NsqlSparkFunctionContext" }, "summary": { "type": "string" }, "user_defined": { "type": "array", "items": { "$ref": "#/components/schemas/UserFunctionContextEntry" } } } }, "NsqlFunctionContextEntry": { "type": "object", "required": [ "name" ], "properties": { "description": { "type": [ "string", "null" ] }, "example": { "type": [ "string", "null" ] }, "function_type": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "signatures": { "type": "array", "items": { "type": "string" } }, "syntax": { "type": [ "string", "null" ] } } }, "NsqlIndexContext": { "type": "object", "required": [ "columns", "kind", "source" ], "properties": { "columns": { "type": "array", "items": { "type": "string" } }, "kind": { "type": "string" }, "name": { "type": [ "string", "null" ] }, "source": { "type": "string" } } }, "NsqlSparkFunctionContext": { "type": "object", "required": [ "description", "functions" ], "properties": { "description": { "type": "string" }, "functions": { "type": "array", "items": { "type": "string" } } } }, "NsqlSqlContext": { "type": "object", "required": [ "engine", "version", "dialect", "parser", "notes" ], "properties": { "dialect": { "type": "string" }, "engine": { "type": "string" }, "notes": { "type": "array", "items": { "type": "string" } }, "parser": { "type": "string" }, "version": { "type": "string" } } }, "NsqlVectorSearchContext": { "type": "object", "required": [ "column", "function", "syntax", "model", "row_id_columns", "chunked", "required_columns", "notes" ], "properties": { "chunked": { "type": "boolean" }, "column": { "type": "string" }, "engine": { "type": [ "string", "null" ] }, "function": { "type": "string" }, "index": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/NsqlIndexContext" } ] }, "input_mode": { "type": [ "string", "null" ] }, "model": { "type": "string" }, "notes": { "type": "array", "items": { "type": "string" } }, "required_columns": { "type": "array", "items": { "type": "string" } }, "row_id_columns": { "type": "array", "items": { "type": "string" } }, "syntax": { "type": "string" }, "vector_size": { "type": [ "integer", "null" ], "minimum": 0 } } }, "NullableEntry": { "oneOf": [ { "type": "string" }, { "type": "array", "items": {} }, { "type": "object", "additionalProperties": {}, "propertyNames": { "type": "string" } }, { "type": "null", "default": null } ], "description": "`TypeSafe` `EntryType`: string, object, array, or null.\n\nUsed for `instructions` and structured criteria descriptions.\nSee ." }, "OutputItem": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/OutputMessage", "description": "An output message from the model." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "message" ] } } } ], "description": "An output message from the model." }, { "allOf": [ { "$ref": "#/components/schemas/FileSearchToolCall", "description": "The results of a file search tool call. See the\n[file search guide](https://platform.openai.com/docs/guides/tools-file-search)\nfor more information." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "file_search_call" ] } } } ], "description": "The results of a file search tool call. See the\n[file search guide](https://platform.openai.com/docs/guides/tools-file-search)\nfor more information." }, { "allOf": [ { "$ref": "#/components/schemas/FunctionToolCall", "description": "A tool call to run a function. See the\n[function calling guide](https://platform.openai.com/docs/guides/function-calling)\nfor more information." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function_call" ] } } } ], "description": "A tool call to run a function. See the\n[function calling guide](https://platform.openai.com/docs/guides/function-calling)\nfor more information." }, { "allOf": [ { "$ref": "#/components/schemas/WebSearchToolCall", "description": "The results of a web search tool call. See the\n[web search guide](https://platform.openai.com/docs/guides/tools-web-search)\nfor more information." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "web_search_call" ] } } } ], "description": "The results of a web search tool call. See the\n[web search guide](https://platform.openai.com/docs/guides/tools-web-search)\nfor more information." }, { "allOf": [ { "$ref": "#/components/schemas/ComputerToolCall", "description": "A tool call to a computer use tool. See the\n[computer use guide](https://platform.openai.com/docs/guides/tools-computer-use)\nfor more information." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "computer_call" ] } } } ], "description": "A tool call to a computer use tool. See the\n[computer use guide](https://platform.openai.com/docs/guides/tools-computer-use)\nfor more information." }, { "allOf": [ { "$ref": "#/components/schemas/ReasoningItem", "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API for\nsubsequent turns of a conversation if you are manually\n[managing context](https://platform.openai.com/docs/guides/conversation-state)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "reasoning" ] } } } ], "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API for\nsubsequent turns of a conversation if you are manually\n[managing context](https://platform.openai.com/docs/guides/conversation-state)." }, { "allOf": [ { "$ref": "#/components/schemas/CompactionBody", "description": "A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "compaction" ] } } } ], "description": "A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact)." }, { "allOf": [ { "$ref": "#/components/schemas/ImageGenToolCall", "description": "An image generation request made by the model." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "image_generation_call" ] } } } ], "description": "An image generation request made by the model." }, { "allOf": [ { "$ref": "#/components/schemas/CodeInterpreterToolCall", "description": "A tool call to run code." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "code_interpreter_call" ] } } } ], "description": "A tool call to run code." }, { "allOf": [ { "$ref": "#/components/schemas/LocalShellToolCall", "description": "A tool call to run a command on the local shell." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "local_shell_call" ] } } } ], "description": "A tool call to run a command on the local shell." }, { "allOf": [ { "$ref": "#/components/schemas/FunctionShellCall", "description": "A tool call that executes one or more shell commands in a managed environment." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "shell_call" ] } } } ], "description": "A tool call that executes one or more shell commands in a managed environment." }, { "allOf": [ { "$ref": "#/components/schemas/FunctionShellCallOutput", "description": "The output of a shell tool call." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "shell_call_output" ] } } } ], "description": "The output of a shell tool call." }, { "allOf": [ { "$ref": "#/components/schemas/ApplyPatchToolCall", "description": "A tool call that applies file diffs by creating, deleting, or updating files." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "apply_patch_call" ] } } } ], "description": "A tool call that applies file diffs by creating, deleting, or updating files." }, { "allOf": [ { "$ref": "#/components/schemas/ApplyPatchToolCallOutput", "description": "The output emitted by an apply patch tool call." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "apply_patch_call_output" ] } } } ], "description": "The output emitted by an apply patch tool call." }, { "allOf": [ { "$ref": "#/components/schemas/MCPToolCall", "description": "An invocation of a tool on an MCP server." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "mcp_call" ] } } } ], "description": "An invocation of a tool on an MCP server." }, { "allOf": [ { "$ref": "#/components/schemas/MCPListTools", "description": "A list of tools available on an MCP server." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "mcp_list_tools" ] } } } ], "description": "A list of tools available on an MCP server." }, { "allOf": [ { "$ref": "#/components/schemas/MCPApprovalRequest", "description": "A request for human approval of a tool invocation." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "mcp_approval_request" ] } } } ], "description": "A request for human approval of a tool invocation." }, { "allOf": [ { "$ref": "#/components/schemas/CustomToolCall", "description": "A call to a custom tool created by the model." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "custom_tool_call" ] } } } ], "description": "A call to a custom tool created by the model." } ], "description": "Output item" }, "OutputMessage": { "type": "object", "description": "A message generated by the model.", "required": [ "content", "id", "role", "status" ], "properties": { "content": { "type": "array", "items": { "$ref": "#/components/schemas/OutputMessageContent" }, "description": "The content of the output message." }, "id": { "type": "string", "description": "The unique ID of the output message." }, "role": { "$ref": "#/components/schemas/AssistantRole", "description": "The role of the output message. Always `assistant`." }, "status": { "$ref": "#/components/schemas/OutputStatus", "description": "The status of the message input. One of `in_progress`, `completed`, or\n`incomplete`. Populated when input items are returned via API." } } }, "OutputMessageContent": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/OutputTextContent", "description": "A text output from the model." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "output_text" ] } } } ], "description": "A text output from the model." }, { "allOf": [ { "$ref": "#/components/schemas/RefusalContent", "description": "A refusal from the model." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "refusal" ] } } } ], "description": "A refusal from the model." } ] }, "OutputStatus": { "type": "string", "description": "Status of input/output items.", "enum": [ "in_progress", "completed", "incomplete" ] }, "OutputTextContent": { "type": "object", "description": "A simple text output from the model.", "required": [ "annotations", "text" ], "properties": { "annotations": { "type": "array", "items": { "$ref": "#/components/schemas/Annotation" }, "description": "The annotations of the text output." }, "logprobs": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/LogProb" } }, "text": { "type": "string", "description": "The text output from the model." } } }, "OutputTokenDetails": { "type": "object", "required": [ "reasoning_tokens" ], "properties": { "reasoning_tokens": { "type": "integer", "format": "int32", "description": "The number of reasoning tokens.", "minimum": 0 } } }, "PredictionContent": { "oneOf": [ { "type": "object", "description": "The type of the predicted content you want to provide. This type is\ncurrently always `content`.", "required": [ "content", "type" ], "properties": { "content": { "$ref": "#/components/schemas/PredictionContentContent", "description": "The type of the predicted content you want to provide. This type is\ncurrently always `content`." }, "type": { "type": "string", "enum": [ "content" ] } } } ], "description": "Static predicted output content, such as the content of a text file that is being regenerated." }, "PredictionContentContent": { "oneOf": [ { "type": "string", "description": "The content used for a Predicted Output. This is often the text of a file you are regenerating with minor changes." }, { "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionRequestMessageContentPartText" }, "description": "An array of content parts with a defined type. Supported options differ based on the [model](https://platform.openai.com/docs/models) being used to generate the response. Can contain text inputs." } ], "description": "The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly." }, "Prompt": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "The unique identifier of the prompt template to use." }, "variables": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ResponsePromptVariables", "description": "Optional map of values to substitute in for variables in your\nprompt. The substitution values can either be strings, or other\nResponse input types like images or files." } ] }, "version": { "type": [ "string", "null" ], "description": "Optional version of the prompt template." } } }, "PromptCacheRetention": { "type": "string", "description": "The retention policy for the prompt cache.", "enum": [ "in_memory", "24h" ] }, "PromptTokensDetails": { "type": "object", "description": "Breakdown of tokens used in a completion.", "properties": { "audio_tokens": { "type": [ "integer", "null" ], "format": "int32", "description": "Audio input tokens present in the prompt.", "minimum": 0 }, "cached_tokens": { "type": [ "integer", "null" ], "format": "int32", "description": "Cached tokens present in the prompt.", "minimum": 0 } } }, "Question": { "oneOf": [ { "type": "object", "description": "Yes/no probability question. Answer is `noul` in \\[0, 1\\] (P(yes)).", "required": [ "type" ], "properties": { "criteria": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/NoulCriteria" } ] }, "instructions": { "$ref": "#/components/schemas/NullableEntry" }, "type": { "type": "string", "enum": [ "noul" ] } } }, { "type": "object", "description": "Closed-set selection. Answer is the highest-probability option plus the full distribution.", "required": [ "criteria", "type" ], "properties": { "criteria": { "type": "object", "description": "Option id → description (`EntryType`, or JSON null).", "additionalProperties": { "$ref": "#/components/schemas/EntryType" }, "propertyNames": { "type": "string" } }, "instructions": { "$ref": "#/components/schemas/NullableEntry" }, "type": { "type": "string", "enum": [ "choice" ] } } }, { "type": "object", "description": "Ordered rubric score. Answer is a probability-weighted value across levels.", "required": [ "criteria", "type" ], "properties": { "criteria": { "type": "array", "items": { "$ref": "#/components/schemas/NonNullEntry" }, "description": "Two to ten non-null rubric levels: `TypeSafe` documents score criteria as\n\"at least two levels and takes up to 10\"\n().", "maxItems": 10, "minItems": 2 }, "instructions": { "$ref": "#/components/schemas/NullableEntry" }, "type": { "type": "string", "enum": [ "score" ] } } } ], "description": "A typed question sent to a System One evaluation model.\n\n`instructions` uses [`NullableEntry`] so an explicit JSON `null` survives the round\ntrip to `TypeSafe` instead of collapsing into an omitted field." }, "RankVersionType": { "type": "string", "enum": [ "auto", "default-2024-11-15" ] }, "RankingOptions": { "type": "object", "description": "Options for search result ranking.", "required": [ "ranker" ], "properties": { "hybrid_search": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/HybridSearch", "description": "Weights that control how reciprocal rank fusion balances semantic embedding matches versus\nsparse keyword matches when hybrid search is enabled." } ] }, "ranker": { "$ref": "#/components/schemas/RankVersionType", "description": "The ranker to use for the file search." }, "score_threshold": { "type": [ "number", "null" ], "format": "float", "description": "The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will\nattempt to return only the most relevant results, but may return fewer results." } } }, "Reasoning": { "type": "object", "description": "o-series reasoning settings.", "properties": { "effort": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ReasoningEffort", "description": "Constrains effort on reasoning for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `minimal`, `low`, `medium`, and `high`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.\n\nNote: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort." } ] }, "summary": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ReasoningSummary", "description": "A summary of the reasoning performed by the model. This can be\nuseful for debugging and understanding the model's reasoning process.\nOne of `auto`, `concise`, or `detailed`.\n\n`concise` is supported for `computer-use-preview` models and all reasoning models after\n`gpt-5`." } ] } } }, "ReasoningEffort": { "type": "string", "enum": [ "none", "minimal", "low", "medium", "high", "xhigh" ] }, "ReasoningItem": { "type": "object", "description": "A reasoning item representing the model's chain of thought, including summary paragraphs.", "required": [ "id", "summary" ], "properties": { "content": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/ReasoningTextContent" }, "description": "Reasoning text content." }, "encrypted_content": { "type": [ "string", "null" ], "description": "The encrypted content of the reasoning item - populated when a response is generated with\n`reasoning.encrypted_content` in the `include` parameter." }, "id": { "type": "string", "description": "Unique identifier of the reasoning content." }, "status": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/OutputStatus", "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`.\nPopulated when items are returned via API." } ] }, "summary": { "type": "array", "items": { "$ref": "#/components/schemas/SummaryPart" }, "description": "Reasoning summary content." } } }, "ReasoningSummary": { "type": "string", "enum": [ "auto", "concise", "detailed" ] }, "ReasoningTextContent": { "type": "object", "required": [ "text" ], "properties": { "text": { "type": "string", "description": "The reasoning text from the model." } } }, "RefreshMode": { "type": "string", "enum": [ "disabled", "full", "append", "changes", "caching", "snapshot" ] }, "RefreshOverrides": { "type": "object", "description": "[`RefreshOverrides`] specifies the configurable options for a individual run of a refresh task.", "properties": { "refresh_jitter_max": { "type": [ "string", "null" ], "description": "The maximum amount of jitter to add to the refresh. Defaults to the `refresh_jitter_max` specified in the spicepod, or 10% of the `refresh_check_interval`.", "example": "10s" }, "refresh_mode": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/RefreshMode", "description": "The refresh mode to use for this refresh. Defaults to the `refresh_mode` specified in the spicepod, or `full`." } ] }, "refresh_sql": { "type": [ "string", "null" ], "description": "The SQL statement used for this refresh. Defaults to the `refresh_sql` specified in the spicepod, if any." } } }, "RefusalContent": { "type": "object", "description": "A refusal explanation from the model.", "required": [ "refusal" ], "properties": { "refusal": { "type": "string", "description": "The refusal explanation from the model." } } }, "Request": { "type": "object", "required": [ "query" ], "properties": { "datasets": { "type": [ "array", "null" ], "items": { "type": "string" }, "description": "Names of datasets to sample from when constructing model context; this is a sampling hint and does not restrict which tables queries can target. If omitted, all datasets are used." }, "model": { "type": [ "string", "null" ], "description": "The name of the model to use for SQL generation. If omitted, Spice defaults to the only compatible LLM model configured in the Spicepod." }, "prompt_cache_key": { "type": [ "string", "null" ], "description": "Stable prompt-cache key forwarded to the configured NSQL model for provider-specific cache handling." }, "query": { "type": "string", "description": "The natural language query to be converted into SQL" }, "sample_data_enabled": { "type": "boolean", "description": "Whether sample data is included in the context for SQL generation. Default: false" }, "stream": { "type": "boolean", "description": "If true, streams the response instead of waiting for completion" } } }, "Response": { "type": "object", "description": "The complete response returned by the Responses API.", "required": [ "created_at", "id", "model", "object", "output", "status" ], "properties": { "background": { "type": [ "boolean", "null" ], "description": "Whether to run the model response in the background.\n[Learn more](https://platform.openai.com/docs/guides/background)." }, "billing": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Billing", "description": "Billing information for the response." } ] }, "conversation": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Conversation", "description": "The conversation that this response belongs to. Input items and output\nitems from this response are automatically added to this conversation." } ] }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (in seconds) when this Response was created.", "minimum": 0 }, "error": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ErrorObject", "description": "An error object returned when the model fails to generate a Response." } ] }, "id": { "type": "string", "description": "Unique identifier for this response." }, "incomplete_details": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/IncompleteDetails", "description": "Details about why the response is incomplete, if any." } ] }, "instructions": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Instructions", "description": "A system (or developer) message inserted into the model's context.\n\nWhen using along with `previous_response_id`, the instructions from a previous response\nwill not be carried over to the next response. This makes it simple to swap out\nsystem (or developer) messages in new responses." } ] }, "max_output_tokens": { "type": [ "integer", "null" ], "format": "int32", "description": "An upper bound for the number of tokens that can be generated for a response,\nincluding visible output tokens and\n[reasoning tokens](https://platform.openai.com/docs/guides/reasoning).", "minimum": 0 }, "metadata": { "type": [ "object", "null" ], "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", "additionalProperties": { "type": "string" }, "propertyNames": { "type": "string" } }, "model": { "type": "string", "description": "Model ID used to generate the response, like gpt-4o or o3. OpenAI offers a\nwide range of models with different capabilities, performance characteristics,\nand price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and compare available models." }, "object": { "type": "string", "description": "The object type of this resource - always set to `response`." }, "output": { "type": "array", "items": { "$ref": "#/components/schemas/OutputItem" }, "description": "An array of content items generated by the model.\n\n- The length and order of items in the output array is dependent on the model's response.\n- Rather than accessing the first item in the output array and assuming it's an assistant\n message with the content generated by the model, you might consider using\n the `output_text` property where supported in SDKs." }, "parallel_tool_calls": { "type": [ "boolean", "null" ], "description": "SDK-only convenience property that contains the aggregated text output from all\n`output_text` items in the `output` array, if any are present.\nSupported in the Python and JavaScript SDKs.\nWhether to allow the model to run tool calls in parallel." }, "previous_response_id": { "type": [ "string", "null" ], "description": "The unique ID of the previous response to the model. Use this to create multi-turn conversations.\nLearn more about [conversation state](https://platform.openai.com/docs/guides/conversation-state).\nCannot be used in conjunction with `conversation`." }, "prompt": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Prompt", "description": "Reference to a prompt template and its variables.\n[Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts)." } ] }, "prompt_cache_key": { "type": [ "string", "null" ], "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces\nthe `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." }, "prompt_cache_retention": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/PromptCacheRetention", "description": "The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching,\nwhich keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn\nmore](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention)." } ] }, "reasoning": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Reasoning", "description": "**gpt-5 and o-series models only**\nConfiguration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning)." } ] }, "safety_identifier": { "type": [ "string", "null" ], "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's\nusage policies.\n\nThe IDs should be a string that uniquely identifies each user. We recommend hashing their username\nor email address, in order to avoid sending us any identifying information. [Learn\nmore](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." }, "service_tier": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ServiceTier", "description": "Specifies the processing type used for serving the request.\n- If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.\n- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.\n- If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier.\n- When not set, the default behavior is 'auto'.\n\nWhen the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter." } ] }, "status": { "$ref": "#/components/schemas/Status", "description": "The status of the response generation.\nOne of `completed`, `failed`, `in_progress`, `cancelled`, `queued`, or `incomplete`." }, "temperature": { "type": [ "number", "null" ], "format": "float", "description": "What sampling temperature was used, between 0 and 2. Higher values like 0.8 make\noutputs more random, lower values like 0.2 make output more focused and deterministic.\n\nWe generally recommend altering this or `top_p` but not both." }, "text": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ResponseTextParam", "description": "Configuration options for a text response from the model. Can be plain\ntext or structured JSON data. Learn more:\n- [Text inputs and outputs](https://platform.openai.com/docs/guides/text)\n- [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)" } ] }, "tool_choice": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ToolChoiceParam", "description": "How the model should select which tool (or tools) to use when generating\na response. See the `tools` parameter to see how to specify which tools\nthe model can call." } ] }, "tools": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/Tool" }, "description": "An array of tools the model may call while generating a response. You\ncan specify which tool to use by setting the `tool_choice` parameter.\n\nWe support the following categories of tools:\n- **Built-in tools**: Tools that are provided by OpenAI that extend the\n model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search)\n or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about\n [built-in tools](https://platform.openai.com/docs/guides/tools).\n- **MCP Tools**: Integrations with third-party systems via custom MCP servers\n or predefined connectors such as Google Drive and SharePoint. Learn more about\n [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).\n- **Function calls (custom tools)**: Functions that are defined by you,\n enabling the model to call your own code with strongly typed arguments\n and outputs. Learn more about\n [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use\n custom tools to call your own code." }, "top_logprobs": { "type": [ "integer", "null" ], "format": "int32", "description": "An integer between 0 and 20 specifying the number of most likely tokens to return at each\ntoken position, each with an associated log probability.", "minimum": 0 }, "top_p": { "type": [ "number", "null" ], "format": "float", "description": "An alternative to sampling with temperature, called nucleus sampling,\nwhere the model considers the results of the tokens with top_p probability\nmass. So 0.1 means only the tokens comprising the top 10% probability mass\nare considered.\n\nWe generally recommend altering this or `temperature` but not both." }, "truncation": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Truncation", "description": "The truncation strategy to use for the model response.\n - `auto`: If the input to this Response exceeds\n the model's context window size, the model will truncate the\n response to fit the context window by dropping items from the beginning of the conversation.\n - `disabled` (default): If the input size will exceed the context window\n size for a model, the request will fail with a 400 error." } ] }, "usage": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/ResponseUsage", "description": "Represents token usage details including input tokens, output tokens,\na breakdown of output tokens, and the total tokens used." } ] } } }, "ResponseFormat": { "oneOf": [ { "type": "object", "description": "The type of response format being defined: `text`", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text" ] } } }, { "type": "object", "description": "The type of response format being defined: `json_object`", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "json_object" ] } } }, { "type": "object", "description": "The type of response format being defined: `json_schema`", "required": [ "json_schema", "type" ], "properties": { "json_schema": { "$ref": "#/components/schemas/ResponseFormatJsonSchema" }, "type": { "type": "string", "enum": [ "json_schema" ] } } } ] }, "ResponseFormatJsonSchema": { "type": "object", "required": [ "name" ], "properties": { "description": { "type": [ "string", "null" ], "description": "A description of what the response format is for, used by the model to determine how to respond in the format." }, "name": { "type": "string", "description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64." }, "schema": { "description": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/)." }, "strict": { "type": [ "boolean", "null" ], "description": "Whether to enable strict schema adherence when generating the output.\nIf set to true, the model will always follow the exact schema defined\nin the `schema` field. Only a subset of JSON Schema is supported when\n`strict` is `true`. To learn more, read the [Structured Outputs\nguide](https://platform.openai.com/docs/guides/structured-outputs)." } } }, "ResponseModalities": { "type": "string", "description": "Output types that you would like the model to generate for this request.\n\nMost models are capable of generating text, which is the default: `[\"text\"]`\n\nThe `gpt-4o-audio-preview` model can also be used to [generate\naudio](https://platform.openai.com/docs/guides/audio). To request that this model generate both text and audio responses, you can use: `[\"text\", \"audio\"]`", "enum": [ "text", "audio" ] }, "ResponsePromptVariables": { "oneOf": [ { "type": "string" }, { "$ref": "#/components/schemas/InputContent" }, {} ] }, "ResponseStreamOptions": { "type": "object", "properties": { "include_obfuscation": { "type": [ "boolean", "null" ], "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\nrandom characters to an `obfuscation` field on streaming delta events to\nnormalize payload sizes as a mitigation to certain side-channel attacks.\nThese obfuscation fields are included by default, but add a small amount\nof overhead to the data stream. You can set `include_obfuscation` to\nfalse to optimize for bandwidth if you trust the network links between\nyour application and the OpenAI API." } } }, "ResponseTextParam": { "type": "object", "description": "Configuration for text response format.", "required": [ "format" ], "properties": { "format": { "$ref": "#/components/schemas/TextResponseFormatConfiguration", "description": "An object specifying the format that the model must output.\n\nConfiguring `{ \"type\": \"json_schema\" }` enables Structured Outputs,\nwhich ensures the model will match your supplied JSON schema. Learn more in the\n[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).\n\nThe default format is `{ \"type\": \"text\" }` with no additional options.\n\n**Not recommended for gpt-4o and newer models:**\n\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it." }, "verbosity": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Verbosity", "description": "Constrains the verbosity of the model's response. Lower values will result in\nmore concise responses, while higher values will result in more verbose responses.\n\nCurrently supported values are `low`, `medium`, and `high`." } ] } } }, "ResponseUsage": { "type": "object", "description": "Usage statistics for a response.", "required": [ "input_tokens", "input_tokens_details", "output_tokens", "output_tokens_details", "total_tokens" ], "properties": { "input_tokens": { "type": "integer", "format": "int32", "description": "The number of input tokens.", "minimum": 0 }, "input_tokens_details": { "$ref": "#/components/schemas/InputTokenDetails", "description": "A detailed breakdown of the input tokens." }, "output_tokens": { "type": "integer", "format": "int32", "description": "The number of output tokens.", "minimum": 0 }, "output_tokens_details": { "$ref": "#/components/schemas/OutputTokenDetails", "description": "A detailed breakdown of the output tokens." }, "total_tokens": { "type": "integer", "format": "int32", "description": "The total number of tokens used.", "minimum": 0 } } }, "Role": { "type": "string", "description": "Role of messages in the API.", "enum": [ "user", "assistant", "system", "developer" ] }, "SampleContextBlock": { "type": "object", "required": [ "title", "content" ], "properties": { "content": { "type": "string" }, "title": { "type": "string" } } }, "Scroll": { "type": "object", "description": "A scroll action.", "required": [ "scroll_x", "scroll_y", "x", "y" ], "properties": { "scroll_x": { "type": "integer", "format": "int32", "description": "The horizontal scroll distance." }, "scroll_y": { "type": "integer", "format": "int32", "description": "The vertical scroll distance." }, "x": { "type": "integer", "format": "int32", "description": "The x-coordinate where the scroll occurred." }, "y": { "type": "integer", "format": "int32", "description": "The y-coordinate where the scroll occurred." } } }, "SearchRequestBaseJson": { "type": "object", "required": [ "text" ], "properties": { "additional_columns": { "type": "array", "items": { "type": "string" }, "description": "Additional columns to return from the dataset. If the column is a primary key, it will be\n returned within the response under `.primary_key`, not `.data`." }, "datasets": { "type": [ "array", "null" ], "items": { "type": "string" }, "description": "The datasets to search for similarity. If None, search across all datasets. For available datasets, use the `list_datasets` tool and ensure `can_search_documents==true`." }, "limit": { "type": [ "integer", "null" ], "description": "Number of documents to return for each dataset", "minimum": 0 }, "text": { "type": "string", "description": "The text to search documents for similarity" }, "where": { "type": [ "string", "null" ], "description": "An SQL filter predicate to apply. Format: 'WHERE `where_cond`'." } } }, "SearchRequestHTTPJson": { "allOf": [ { "$ref": "#/components/schemas/SearchRequestBaseJson" }, { "type": "object", "properties": { "keywords": { "type": [ "array", "null" ], "items": { "type": "string" } } } } ], "description": "HTTP request schema is separate from AI requests, so that keywords can be supplied as an optional field for HTTP calls.\n`schemars` doesn't allow setting `#[serde(default)]` as well as `#[schemars(required)]` - the field does not become required.\nWhen the field is not required, the model ignores it." }, "SearchResponse": { "type": "object", "required": [ "results", "duration_ms" ], "properties": { "duration_ms": { "type": "integer", "description": "Total time taken to execute the search, in milliseconds", "minimum": 0 }, "results": { "type": "array", "items": { "$ref": "#/components/schemas/Match" }, "description": "List of matches that were found in the datasets" } } }, "ServiceTier": { "type": "string", "enum": [ "auto", "default", "flex", "scale", "priority" ] }, "SpicepodSummary": { "type": "object", "required": [ "name", "version" ], "properties": { "datasets_count": { "type": "integer", "description": "The number of datasets in this spicepod", "minimum": 0 }, "dependencies_count": { "type": "integer", "description": "The number of dependencies in this spicepod", "minimum": 0 }, "models_count": { "type": "integer", "description": "The number of models in this spicepod", "minimum": 0 }, "name": { "type": "string", "description": "The name of the spicepod" }, "version": { "type": "string", "description": "The version of the spicepod" } } }, "Status": { "type": "string", "enum": [ "completed", "failed", "in_progress", "cancelled", "queued", "incomplete" ] }, "StopConfiguration": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "String": { "oneOf": [ { "type": "string", "description": "The component is initializing and not yet ready", "enum": [ "Initializing" ] }, { "type": "string", "description": "The component is ready to accept connections", "enum": [ "Ready" ] }, { "type": "string", "description": "The component is disabled and not running", "enum": [ "Disabled" ] }, { "type": "object", "description": "An error occurred in the component, with an optional error message", "required": [ "Error" ], "properties": { "Error": { "type": [ "string", "null" ], "description": "An error occurred in the component, with an optional error message" } } }, { "type": "string", "description": "The component is in the process of refreshing its state", "enum": [ "Refreshing" ] }, { "type": "string", "description": "The component is in the process of shutting down", "enum": [ "ShuttingDown" ] }, { "type": "string", "description": "The component is configured but not loaded yet", "enum": [ "NotLoaded" ] } ], "description": "Represents the status of a component (e.g. dataset, model, etc).\n\nThe `Error` variant optionally carries a human-readable error message describing\nwhat caused the component to enter the error state. Use [`ComponentStatus::error`]\nfor an error without a message, or [`ComponentStatus::error_with_message`] to\ninclude one.", "example": "Ready" }, "Summary": { "type": "object", "description": "A single summary text fragment from reasoning.", "required": [ "text" ], "properties": { "text": { "type": "string", "description": "A summary of the reasoning output from the model so far." } } }, "SummaryPart": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/Summary" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] } } } ] } ] }, "TableFormatVersion": { "type": "string", "enum": [ "V2" ] }, "TableIdentifier": { "type": "object", "required": [ "namespace", "name" ], "properties": { "name": { "type": "string" }, "namespace": { "$ref": "#/components/schemas/Namespace" } } }, "TableMetadata": { "type": "object", "required": [ "format-version", "table-uuid", "location", "schemas", "last-updated-ms", "last-column-id", "last-sequence-number", "current-schema-id", "partition-specs", "default-spec-id", "last-partition-id", "sort-orders", "default-sort-order-id" ], "properties": { "current-schema-id": { "type": "integer", "format": "int32", "minimum": 0 }, "default-sort-order-id": { "type": "integer", "format": "int32", "minimum": 0 }, "default-spec-id": { "type": "integer", "format": "int32", "minimum": 0 }, "format-version": { "$ref": "#/components/schemas/TableFormatVersion" }, "last-column-id": { "type": "integer", "format": "int32", "minimum": 0 }, "last-partition-id": { "type": "integer", "format": "int32", "minimum": 0 }, "last-sequence-number": { "type": "integer", "format": "int64", "minimum": 0 }, "last-updated-ms": { "type": "integer", "format": "int64" }, "location": { "type": "string" }, "partition-specs": { "type": "object" }, "schemas": { "type": "object", "description": "Iceberg schemas, see ``." }, "sort-orders": { "type": "object" }, "table-uuid": { "type": "string", "example": "2b9da507-2c07-4bb3-9f0b-8df66a5e9e53" } } }, "TextResponseFormatConfiguration": { "oneOf": [ { "type": "object", "description": "Default response format. Used to generate text responses.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text" ] } } }, { "type": "object", "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it.\nNote that the model will not generate JSON without a system or user message\ninstructing it to do so.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "json_object" ] } } }, { "allOf": [ { "$ref": "#/components/schemas/ResponseFormatJsonSchema", "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "json_schema" ] } } } ], "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)." } ] }, "Tool": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/FunctionTool", "description": "Defines a function in your own code the model can choose to call. Learn more about [function\ncalling](https://platform.openai.com/docs/guides/tools)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function" ] } } } ], "description": "Defines a function in your own code the model can choose to call. Learn more about [function\ncalling](https://platform.openai.com/docs/guides/tools)." }, { "allOf": [ { "$ref": "#/components/schemas/FileSearchTool", "description": "A tool that searches for relevant content from uploaded files. Learn more about the [file search\ntool](https://platform.openai.com/docs/guides/tools-file-search)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "file_search" ] } } } ], "description": "A tool that searches for relevant content from uploaded files. Learn more about the [file search\ntool](https://platform.openai.com/docs/guides/tools-file-search)." }, { "allOf": [ { "$ref": "#/components/schemas/ComputerUsePreviewTool", "description": "A tool that controls a virtual computer. Learn more about the [computer\nuse tool](https://platform.openai.com/docs/guides/tools-computer-use)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "computer_use_preview" ] } } } ], "description": "A tool that controls a virtual computer. Learn more about the [computer\nuse tool](https://platform.openai.com/docs/guides/tools-computer-use)." }, { "allOf": [ { "$ref": "#/components/schemas/WebSearchTool", "description": "Search the Internet for sources related to the prompt. Learn more about the\n[web search tool](https://platform.openai.com/docs/guides/tools-web-search)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "web_search" ] } } } ], "description": "Search the Internet for sources related to the prompt. Learn more about the\n[web search tool](https://platform.openai.com/docs/guides/tools-web-search)." }, { "allOf": [ { "$ref": "#/components/schemas/WebSearchTool", "description": "type: web_search_2025_08_26" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "web_search_2025_08_26" ] } } } ], "description": "type: web_search_2025_08_26" }, { "allOf": [ { "$ref": "#/components/schemas/MCPTool", "description": "Give the model access to additional tools via remote Model Context Protocol\n(MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "mcp" ] } } } ], "description": "Give the model access to additional tools via remote Model Context Protocol\n(MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp)." }, { "allOf": [ { "$ref": "#/components/schemas/CodeInterpreterTool", "description": "A tool that runs Python code to help generate a response to a prompt." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "code_interpreter" ] } } } ], "description": "A tool that runs Python code to help generate a response to a prompt." }, { "allOf": [ { "$ref": "#/components/schemas/ImageGenTool", "description": "A tool that generates images using a model like `gpt-image-1`." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "image_generation" ] } } } ], "description": "A tool that generates images using a model like `gpt-image-1`." }, { "type": "object", "description": "A tool that allows the model to execute shell commands in a local environment.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "local_shell" ] } } }, { "type": "object", "description": "A tool that allows the model to execute shell commands.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "shell" ] } } }, { "allOf": [ { "$ref": "#/components/schemas/CustomToolParam", "description": "A custom tool that processes input using a specified format. Learn more about [custom\ntools](https://platform.openai.com/docs/guides/function-calling#custom-tools)" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "custom" ] } } } ], "description": "A custom tool that processes input using a specified format. Learn more about [custom\ntools](https://platform.openai.com/docs/guides/function-calling#custom-tools)" }, { "allOf": [ { "$ref": "#/components/schemas/WebSearchTool", "description": " This tool searches the web for relevant results to use in a response. Learn more about the [web search\ntool](https://platform.openai.com/docs/guides/tools-web-search)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "web_search_preview" ] } } } ], "description": " This tool searches the web for relevant results to use in a response. Learn more about the [web search\ntool](https://platform.openai.com/docs/guides/tools-web-search)." }, { "allOf": [ { "$ref": "#/components/schemas/WebSearchTool", "description": "type: web_search_preview_2025_03_11" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "web_search_preview_2025_03_11" ] } } } ], "description": "type: web_search_preview_2025_03_11" }, { "type": "object", "description": "Allows the assistant to create, delete, or update files using unified diffs.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "apply_patch" ] } } } ], "description": "Definitions for model-callable tools." }, "ToolChoiceAllowed": { "type": "object", "required": [ "mode", "tools" ], "properties": { "mode": { "$ref": "#/components/schemas/ToolChoiceAllowedMode", "description": "Constrains the tools available to the model to a pre-defined set.\n\n`auto` allows the model to pick from among the allowed tools and generate a\nmessage.\n\n`required` requires the model to call one or more of the allowed tools." }, "tools": { "type": "array", "items": {}, "description": "A list of tool definitions that the model should be allowed to call.\n\nFor the Responses API, the list of tool definitions might look like:\n```json\n[\n { \"type\": \"function\", \"name\": \"get_weather\" },\n { \"type\": \"mcp\", \"server_label\": \"deepwiki\" },\n { \"type\": \"image_generation\" }\n]\n```" } } }, "ToolChoiceAllowedMode": { "type": "string", "enum": [ "auto", "required" ] }, "ToolChoiceCustom": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "The name of the custom tool to call." } } }, "ToolChoiceFunction": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "The name of the function to call." } } }, "ToolChoiceMCP": { "type": "object", "required": [ "name", "server_label" ], "properties": { "name": { "type": "string", "description": "The name of the tool to call on the server." }, "server_label": { "type": "string", "description": "The label of the MCP server to use." } } }, "ToolChoiceOptions": { "type": "string", "enum": [ "none", "auto", "required" ] }, "ToolChoiceParam": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/ToolChoiceAllowed", "description": "Constrains the tools available to the model to a pre-defined set." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "allowed_tools" ] } } } ], "description": "Constrains the tools available to the model to a pre-defined set." }, { "allOf": [ { "$ref": "#/components/schemas/ToolChoiceFunction", "description": "Use this option to force the model to call a specific function." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function" ] } } } ], "description": "Use this option to force the model to call a specific function." }, { "allOf": [ { "$ref": "#/components/schemas/ToolChoiceMCP", "description": "Use this option to force the model to call a specific tool on a remote MCP server." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "mcp" ] } } } ], "description": "Use this option to force the model to call a specific tool on a remote MCP server." }, { "allOf": [ { "$ref": "#/components/schemas/ToolChoiceCustom", "description": "Use this option to force the model to call a custom tool." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "custom" ] } } } ], "description": "Use this option to force the model to call a custom tool." }, { "type": "object", "description": "Forces the model to call the apply_patch tool when executing a tool call.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "apply_patch" ] } } }, { "type": "object", "description": "Forces the model to call the function shell tool when a tool call is required.", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "shell" ] } } }, { "allOf": [ { "$ref": "#/components/schemas/ToolChoiceTypes", "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "hosted" ] } } } ], "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." }, { "allOf": [ { "$ref": "#/components/schemas/ToolChoiceOptions", "description": "Controls which (if any) tool is called by the model.\n\n`none` means the model will not call any tool and instead generates a message.\n\n`auto` means the model can pick between generating a message or calling one or\nmore tools.\n\n`required` means the model must call one or more tools." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "mode" ] } } } ], "description": "Controls which (if any) tool is called by the model.\n\n`none` means the model will not call any tool and instead generates a message.\n\n`auto` means the model can pick between generating a message or calling one or\nmore tools.\n\n`required` means the model must call one or more tools." } ] }, "ToolChoiceTypes": { "oneOf": [ { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "file_search" ] } } }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "web_search_preview" ] } } }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "computer_use_preview" ] } } }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "code_interpreter" ] } } }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "image_generation" ] } } } ], "description": "The type of hosted tool the model should to use. Learn more about\n[built-in tools](https://platform.openai.com/docs/guides/tools)." }, "TopLogProb": { "type": "object", "required": [ "bytes", "logprob", "token" ], "properties": { "bytes": { "type": "array", "items": { "type": "integer", "format": "int32", "minimum": 0 } }, "logprob": { "type": "number", "format": "double" }, "token": { "type": "string" } } }, "TopLogprobs": { "type": "object", "required": [ "token", "logprob" ], "properties": { "bytes": { "type": [ "array", "null" ], "items": { "type": "integer", "format": "int32", "minimum": 0 }, "description": "A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token." }, "logprob": { "type": "number", "format": "float", "description": "The log probability of this token." }, "token": { "type": "string", "description": "The token." } } }, "Truncation": { "type": "string", "description": "Truncation strategies.", "enum": [ "auto", "disabled" ] }, "Type": { "type": "object", "description": "A typing (text entry) action.", "required": [ "text" ], "properties": { "text": { "type": "string", "description": "The text to type." } } }, "UrlCitation": { "type": "object", "required": [ "end_index", "start_index", "title", "url" ], "properties": { "end_index": { "type": "integer", "format": "int32", "description": "The index of the last character of the URL citation in the message.", "minimum": 0 }, "start_index": { "type": "integer", "format": "int32", "description": "The index of the first character of the URL citation in the message.", "minimum": 0 }, "title": { "type": "string", "description": "The title of the web resource." }, "url": { "type": "string", "description": "The URL of the web resource." } } }, "UrlCitationBody": { "type": "object", "required": [ "end_index", "start_index", "title", "url" ], "properties": { "end_index": { "type": "integer", "format": "int32", "description": "The index of the last character of the URL citation in the message.", "minimum": 0 }, "start_index": { "type": "integer", "format": "int32", "description": "The index of the first character of the URL citation in the message.", "minimum": 0 }, "title": { "type": "string", "description": "The title of the web resource." }, "url": { "type": "string", "description": "The URL of the web resource." } } }, "Usage": { "type": "object", "description": "Token usage reported by the provider.", "properties": { "input_tokens": { "type": "integer", "format": "int64", "description": "Defaulted: the provider may report one count without the other, and a partial\n`usage` block must not fail an otherwise successful evaluation.", "minimum": 0 }, "output_tokens": { "type": "integer", "format": "int64", "minimum": 0 } } }, "UserFunctionContextEntry": { "type": "object", "required": [ "name", "kind", "volatility", "from" ], "properties": { "description": { "type": [ "string", "null" ] }, "from": { "type": "string" }, "kind": { "type": "string" }, "name": { "type": "string" }, "syntax": { "type": [ "string", "null" ] }, "volatility": { "type": "string" } } }, "Verbosity": { "type": "string", "description": "o-series reasoning settings.", "enum": [ "low", "medium", "high" ] }, "WebSearchActionFind": { "type": "object", "required": [ "url", "pattern" ], "properties": { "pattern": { "type": "string", "description": "The pattern or text to search for within the page." }, "url": { "type": "string", "description": "The URL of the page searched for the pattern." } } }, "WebSearchActionOpenPage": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string", "description": "The URL opened by the model." } } }, "WebSearchActionSearch": { "type": "object", "required": [ "query" ], "properties": { "query": { "type": "string", "description": "The search query." }, "sources": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/WebSearchActionSearchSource" }, "description": "The sources used in the search." } } }, "WebSearchActionSearchSource": { "type": "object", "required": [ "type", "url" ], "properties": { "type": { "type": "string", "description": "The type of source. Always `url`." }, "url": { "type": "string", "description": "The URL of the source." } } }, "WebSearchApproximateLocation": { "type": "object", "description": "Approximate user location for web search.", "required": [ "type" ], "properties": { "city": { "type": [ "string", "null" ], "description": "Free text input for the city of the user, e.g. `San Francisco`." }, "country": { "type": [ "string", "null" ], "description": "The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user,\ne.g. `US`." }, "region": { "type": [ "string", "null" ], "description": "Free text input for the region of the user, e.g. `California`." }, "timezone": { "type": [ "string", "null" ], "description": "The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g.\n`America/Los_Angeles`." }, "type": { "$ref": "#/components/schemas/WebSearchApproximateLocationType", "description": "The type of location approximation. Always `approximate`." } } }, "WebSearchApproximateLocationType": { "type": "string", "enum": [ "approximate" ] }, "WebSearchContextSize": { "type": "string", "description": "The amount of context window space to use for the search.", "enum": [ "low", "medium", "high" ] }, "WebSearchLocation": { "type": "object", "description": "Approximate location parameters for the search.", "properties": { "city": { "type": [ "string", "null" ], "description": "Free text input for the city of the user, e.g. `San Francisco`." }, "country": { "type": [ "string", "null" ], "description": "The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`." }, "region": { "type": [ "string", "null" ], "description": "Free text input for the region of the user, e.g. `California`." }, "timezone": { "type": [ "string", "null" ], "description": "The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`." } } }, "WebSearchOptions": { "type": "object", "description": "Options for the web search tool.", "properties": { "search_context_size": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/WebSearchContextSize", "description": "High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default." } ] }, "user_location": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/WebSearchUserLocation", "description": "Approximate location parameters for the search." } ] } } }, "WebSearchTool": { "type": "object", "properties": { "filters": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/WebSearchToolFilters", "description": "Filters for the search." } ] }, "search_context_size": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/WebSearchToolSearchContextSize", "description": "High level guidance for the amount of context window space to use for the search. One of `low`,\n`medium`, or `high`. `medium` is the default." } ] }, "user_location": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/WebSearchApproximateLocation", "description": "The approximate location of the user." } ] } } }, "WebSearchToolCall": { "type": "object", "description": "Web search tool call output.", "required": [ "action", "id", "status" ], "properties": { "action": { "$ref": "#/components/schemas/WebSearchToolCallAction", "description": "An object describing the specific action taken in this web search call. Includes\ndetails on how the model used the web (search, open_page, find)." }, "id": { "type": "string", "description": "The unique ID of the web search tool call." }, "status": { "$ref": "#/components/schemas/WebSearchToolCallStatus", "description": "The status of the web search tool call." } } }, "WebSearchToolCallAction": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/WebSearchActionSearch", "description": "Action type \"search\" - Performs a web search query." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "search" ] } } } ], "description": "Action type \"search\" - Performs a web search query." }, { "allOf": [ { "$ref": "#/components/schemas/WebSearchActionOpenPage", "description": "Action type \"open_page\" - Opens a specific URL from search results." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "open_page" ] } } } ], "description": "Action type \"open_page\" - Opens a specific URL from search results." }, { "allOf": [ { "$ref": "#/components/schemas/WebSearchActionFind", "description": "Action type \"find\": Searches for a pattern within a loaded page." }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "find" ] } } } ], "description": "Action type \"find\": Searches for a pattern within a loaded page." } ] }, "WebSearchToolCallStatus": { "type": "string", "enum": [ "in_progress", "searching", "completed", "failed" ] }, "WebSearchToolFilters": { "type": "object", "properties": { "allowed_domains": { "type": [ "array", "null" ], "items": { "type": "string" }, "description": "Allowed domains for the search. If not provided, all domains are allowed.\nSubdomains of the provided domains are allowed as well.\n\nExample: `[\"pubmed.ncbi.nlm.nih.gov\"]`" } } }, "WebSearchToolSearchContextSize": { "type": "string", "enum": [ "low", "medium", "high" ] }, "WebSearchUserLocation": { "type": "object", "required": [ "type", "approximate" ], "properties": { "approximate": { "$ref": "#/components/schemas/WebSearchLocation" }, "type": { "$ref": "#/components/schemas/WebSearchUserLocationType" } } }, "WebSearchUserLocationType": { "type": "string", "enum": [ "approximate" ] }, "WorkerInfo": { "type": "object", "description": "Worker information returned in the `/v1/workers` response.", "required": [ "name", "is_llm" ], "properties": { "description": { "type": [ "string", "null" ], "description": "A description of what the worker does" }, "is_llm": { "type": "boolean", "description": "Whether this worker can be used as an LLM model" }, "name": { "type": "string", "description": "The name of the worker" }, "status": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/String", "description": "The status of the worker (e.g., `Ready`, `Initializing`, `Error`)" } ] } } }, "WorkerListResponse": { "type": "object", "description": "Response wrapper for the `/v1/workers` endpoint.", "required": [ "object", "data" ], "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/WorkerInfo" }, "description": "The list of workers" }, "object": { "type": "string", "description": "The type of the response (always `list`)" } } } } }, "security": [ { "api_key": [] } ] }