{ "openapi": "3.1.1", "info": { "title": "SambaNova cloud API", "description": "SambaNova cloud API Specification", "version": "1.2.0", "termsOfService": "https://sambanova.ai/cloud-end-user-license-agreement", "contact": { "email": "info@sambanova.ai", "name": "SambaNova information" }, "license": { "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" } }, "externalDocs": { "description": "Find out more in the official SambaNova docs", "url": "https://docs.sambanova.ai/docs/en/api-reference/overview" }, "servers": [{ "url": "https://api.sambanova.ai/v1" }], "components": { "securitySchemes": { "api_key": { "type": "http", "description": "SambaNova API key, sent as a bearer token in the `Authorization` header (`Authorization: Bearer `). Default authentication scheme used by the SambaNova SDK across every OpenAI compatible endpoint.", "scheme": "bearer", "bearerFormat": "apiKey" }, "x_api_key": { "type": "apiKey", "description": "SambaNova API key, sent in the `x-api-key` header. Accepted on the Messages API routes (`/messages`, `/messages/count_tokens`) so that callers can point the official Anthropic SDK at SambaNova by swapping `base_url` — no code changes. The credential value is the same as the bearer `api_key` scheme; only the transport differs.", "in": "header", "name": "x-api-key" } }, "schemas": { "ModelOutputError": { "title": "ModelOutputError", "type": "object", "description": "error in model output generation", "properties": { "error": { "type": "object", "properties": { "code": { "title": "code", "type": "string", "description": "error code", "nullable": true }, "message": { "title": "message", "type": "string", "description": "error message" }, "model_output": { "title": "model_output", "type": "string", "description": "raw output with errors generated by the model", "x-stainless-naming": { "python": { "property_name": "raw_output" } } }, "param": { "title": "param", "type": "string", "description": "error params", "nullable": true }, "type": { "title": "type", "type": "string", "description": "error type" } } } }, "required": ["error"] }, "GeneralError": { "title": "GeneralError", "type": "object", "description": "other kind of errors", "properties": { "error": { "type": "object", "properties": { "code": { "title": "code", "type": "string", "description": "error code", "nullable": true }, "message": { "title": "message", "type": "string", "description": "error message" }, "param": { "title": "param", "type": "string", "description": "error params", "nullable": true }, "type": { "title": "type", "type": "string", "description": "error type" }, "error_model_output": { "title": "Error Model Output", "type": "string", "description": "Raw model output that could not be parsed. Present on `server_error` responses when the model produced output that failed internal parsing (e.g. a malformed tool call JSON).", "nullable": true } } }, "request_id": { "title": "request_id", "type": "string", "description": "unique request identifier for debugging", "nullable": true } }, "required": ["error"] }, "SimpleError": { "title": "SimpleError", "type": "object", "description": "other kind of simple schema errors", "properties": { "error": { "title": "error", "type": "string", "description": "error detail.", "nullable": true } }, "required": ["error"] }, "MessageError": { "title": "Message Error", "type": "object", "description": "Inner error object carried inside a `MessageErrorResponse`. The `type` value follows Anthropic's published error taxonomy.", "properties": { "type": { "title": "Type", "type": "string", "description": "Error category. Values follow Anthropic's taxonomy.", "enum": [ "invalid_request_error", "authentication_error", "permission_error", "not_found_error", "request_too_large", "rate_limit_error", "api_error", "overloaded_error", "not_implemented_error" ] }, "message": { "title": "Message", "type": "string", "description": "Human-readable explanation of the error." } }, "required": ["type", "message"] }, "MessageErrorResponse": { "title": "Message Error Response", "type": "object", "description": "Top-level error envelope returned by the Messages API on any non-2xx response. Shape matches Anthropic's wire format. This envelope is used ONLY on `/messages` and `/messages/count_tokens`", "properties": { "type": { "title": "Type", "type": "string", "description": "Always `error` for error envelopes.", "enum": ["error"], "const": "error" }, "error": { "$ref": "#/components/schemas/MessageError" }, "request_id": { "title": "Request Id", "type": "string", "description": "Opaque request identifier echoed by the server, useful for correlating client-side failures with server-side logs.", "nullable": true } }, "required": ["type", "error"] }, "TextContent": { "title": "Text Content", "type": "object", "additionalProperties": true, "properties": { "type": { "title": "Type", "type": "string", "description": "type of content to send. in this case `text`.", "enum": ["text"], "const": "text" }, "text": { "title": "Text", "type": "string", "description": "string content of the message" } }, "required": ["type", "text"] }, "ImageContent": { "title": "Image Content", "type": "object", "additionalProperties": true, "properties": { "type": { "title": "Type", "type": "string", "description": "type of content to send. in this case `image_url`.", "enum": ["image_url"], "const": "image_url" }, "image_url": { "title": "Image Url", "type": "object", "properties": { "url": { "title": "Url", "type": "string", "description": "Either a URL of the image or the base64 encoded image data. currently only base64 encoded image supported" } } } }, "required": ["type", "image_url"] }, "AudioContent": { "title": "Audio Content", "type": "object", "additionalProperties": true, "properties": { "type": { "title": "Type", "type": "string", "description": "type of content to send. in this case `audio_content`.", "enum": ["audio_content"], "const": "audio_content" }, "audio_content": { "title": "Audio Content", "type": "object", "properties": { "content": { "title": "Content", "type": "string", "description": "the base64 encoded audio data." } } } }, "required": ["type", "audio_content"] }, "VideoContent": { "title": "Video Content", "type": "object", "additionalProperties": true, "properties": { "type": { "title": "Type", "type": "string", "description": "type of content to send. in this case `video_url`.", "enum": ["video_url"], "const": "video_url" }, "video_url": { "title": "Video Url", "type": "object", "properties": { "url": { "title": "Url", "type": "string", "description": "Either a URL of the video or the base64 encoded video data." } } } }, "required": ["type", "video_url"] }, "JSONSchema": { "title": "JSONSchema", "type": "object", "additionalProperties": true, "description": "A JSON Schema definition the model's structured output. Follows standard JSON Schema syntax.", "properties": { "description": { "type": "string", "title": "Description", "description": "description the json schema", "nullable": true }, "name": { "title": "Name", "type": "string", "description": "name of the object schema" }, "schema": { "type": "object", "title": "Schema", "description": "Actual json schema object", "nullable": true }, "strict": { "type": "boolean", "title": "Strict", "description": "whether or not to do an strict validation of the schema", "nullable": true, "default": false } }, "required": ["name"] }, "ResponseFormatJSONObject": { "title": "ResponseFormatJSONObject", "type": "object", "description": "Specifies that the model should produce output as a raw JSON object.", "additionalProperties": true, "properties": { "type": { "const": "json_object", "enum": ["json_object"], "title": "Type", "type": "string" } }, "required": ["type"], "example": { "type": "json_object" } }, "ResponseFormatJSONSchema": { "title": "ResponseFormatJSONSchema", "type": "object", "additionalProperties": true, "description": "Specifies that the model should produce output conforming to a given JSON schema.", "properties": { "json_schema": { "$ref": "#/components/schemas/JSONSchema" }, "type": { "const": "json_schema", "enum": ["json_schema"], "title": "Type", "type": "string" } }, "required": ["json_schema", "type"], "example": { "type": "json_schema", "json_schema": { "name": "User", "description": "JSON schema for a simple user object", "strict": false, "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique identifier for the user" }, "name": { "type": "string", "description": "Full name of the user" } }, "required": ["id", "name"] } } } }, "ResponseFormatText": { "title": "ResponseFormatText", "type": "object", "description": "Specifies that the model should produce output as plain text. This value is not supported yet in the chat compeltions api, if this behavior is desired do not set response format.", "additionalProperties": true, "properties": { "type": { "const": "text", "enum": ["text"], "title": "Type", "type": "string" } }, "required": ["type"] }, "FunctionParameters": { "title": "Function Parameters", "type": "object", "additionalProperties": true, "description": "The parameters the functions accepts, described as a JSON Schema object. see the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting `parameters` defines a function with an empty parameter list." }, "FunctionObject": { "title": "Function Object", "additionalProperties": true, "type": "object", "properties": { "name": { "title": "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." }, "description": { "title": "Description", "type": "string", "description": "A description of what the function does, used by the model to choose when and how to call the function.", "nullable": true }, "parameters": { "$ref": "#/components/schemas/FunctionParameters" } }, "required": ["name"] }, "Tool": { "title": "Tool", "type": "object", "additionalProperties": true, "properties": { "function": { "$ref": "#/components/schemas/FunctionObject" }, "type": { "title": "Type", "type": "string", "description": "The type of the tool. Currently, only `function` is supported." } }, "required": ["type", "function"] }, "ToolChoiceObject": { "title": "ToolChoiceObject", "type": "object", "additionalProperties": true, "properties": { "function": { "title": "Function", "type": "object", "description": "Specifies a tool the model should use. Use it to force the model to call that specific tool.", "additionalProperties": true, "properties": { "name": { "title": "Name", "type": "string", "description": "the name of the tool expected to be used by the model" } }, "required": ["name"] }, "type": { "type": "string", "description": "The type of the tool. only `function` is supported.", "enum": ["function"] } }, "required": ["function", "type"] }, "AssistantToolCallFunction": { "title": "AssistantToolCallFunction", "type": "object", "description": "The tool that the model called.", "additionalProperties": true, "properties": { "name": { "title": "Name", "type": "string", "description": "The name of the function to call.", "nullable": true }, "arguments": { "title": "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.", "nullable": true } } }, "AssistantToolCall": { "title": "AssistantToolCall", "type": "object", "additionalProperties": true, "properties": { "function": { "$ref": "#/components/schemas/AssistantToolCallFunction" }, "id": { "title": "Id", "type": "string", "description": "ID of the tool call.", "nullable": true }, "type": { "title": "Type", "type": "string", "description": "type of the tool cal. only `function` is supported.", "enum": ["function"], "const": "function", "nullable": true }, "index": { "title": "index", "description": "index of tool call chunk only used when using streaming", "type": "integer", "nullable": true } }, "required": ["function"] }, "SystemMessage": { "title": "System Message", "type": "object", "additionalProperties": true, "properties": { "role": { "title": "Role", "type": "string", "description": "The role of the messages author, in this case `system`.", "enum": ["system"], "const": "system" }, "content": { "title": "Content", "anyOf": [ { "type": "string" }, { "title": "Text Content Part Array", "type": "array", "items": { "$ref": "#/components/schemas/TextContent" } } ], "description": "The contents of the system message.", "nullable": true } }, "required": ["role", "content"] }, "UserMessage": { "title": "User Message", "type": "object", "additionalProperties": true, "properties": { "role": { "title": "Role", "type": "string", "description": "The role of the messages author, in this case `user`.", "enum": ["user"], "const": "user" }, "content": { "title": "Content", "description": "The contents of the user message.", "anyOf": [ { "type": "string" }, { "title": "Multicontent Part Array", "type": "array", "items": { "anyOf": [ { "$ref": "#/components/schemas/TextContent" }, { "$ref": "#/components/schemas/ImageContent" }, { "$ref": "#/components/schemas/AudioContent" }, { "$ref": "#/components/schemas/VideoContent" } ] } } ], "nullable": true } }, "required": ["role", "content"] }, "AssistantMessage": { "title": "Assistant Message", "type": "object", "additionalProperties": true, "properties": { "role": { "title": "Role", "type": "string", "description": "The role of the messages author, in this case `assistant`.", "enum": ["assistant"], "const": "assistant" }, "content": { "title": "Content", "anyOf": [ { "type": "string" }, { "title": "Text Content Part Array", "type": "array", "items": { "$ref": "#/components/schemas/TextContent" } } ], "description": "The contents of the assistant message.", "nullable": true }, "reasoning": { "title": "Reasoning", "type": "string", "description": "Reasoning (returned by reasoning models like gpt oss)", "nullable": true }, "channel": { "title": "Channel", "type": "string", "description": "Channel (returned by reasoning models like gpt oss)", "nullable": true }, "tool_calls": { "title": "Tool Calls", "type": "array", "items": { "$ref": "#/components/schemas/AssistantToolCall" }, "description": "The tool calls generated by the model.", "nullable": true } }, "required": ["role", "content"] }, "ToolMessage": { "title": "Tool Message", "type": "object", "additionalProperties": true, "properties": { "role": { "title": "Role", "type": "string", "description": "The role of the messages author, in this case `tool`.", "enum": ["tool"], "const": "tool" }, "content": { "title": "Content", "description": "The contents of the tool message.", "anyOf": [ { "type": "string" }, { "title": "Text Content Part Array", "type": "array", "items": { "$ref": "#/components/schemas/TextContent" } } ] } }, "required": ["content", "role"] }, "EnableThinking": { "title": "Enable Thinking", "type": "boolean", "description": "Enables the model's internal reasoning or \"thinking\" mode, if supported by the chat template (deepseek models).", "example": true }, "ChatCompletionRequest": { "title": "Chat Completion Request", "type": "object", "description": "chat completions request object", "additionalProperties": true, "properties": { "model": { "title": "Model", "description": "The model ID to use (e.g. gpt-oss-120b). See available [models](https://docs.sambanova.ai/docs/en/models/sambacloud-models)", "anyOf": [ { "type": "string" }, { "enum": [ "Meta-Llama-3.3-70B-Instruct", "Meta-Llama-3.2-1B-Instruct", "Meta-Llama-3.2-3B-Instruct", "Llama-3.2-11B-Vision-Instruct", "Llama-3.2-90B-Vision-Instruct", "Meta-Llama-3.1-8B-Instruct", "Meta-Llama-3.1-70B-Instruct", "Meta-Llama-3.1-405B-Instruct", "Qwen2.5-Coder-32B-Instruct", "Qwen2.5-72B-Instruct", "QwQ-32B-Preview", "Meta-Llama-Guard-3-8B", "DeepSeek-R1", "DeepSeek-R1-0528", "DeepSeek-V3-0324", "DeepSeek-V3.1", "DeepSeek-V3.1-cb", "DeepSeek-V3.1-Terminus", "DeepSeek-V3.2", "DeepSeek-R1-Distill-Llama-70B", "Llama-4-Maverick-17B-128E-Instruct", "Llama-4-Scout-17B-16E-Instruct", "Qwen3-32B", "Qwen3-235B", "Llama-3.3-Swallow-70B-Instruct-v0.4", "gpt-oss-120b", "ALLaM-7B-Instruct-preview", "MiniMax-M2.5", "MiniMax-M2.7", "gemma-3-12b-it" ] } ] }, "messages": { "title": "Messages", "type": "array", "description": "A list of messages comprising the conversation so far.", "items": { "anyOf": [ { "$ref": "#/components/schemas/SystemMessage" }, { "$ref": "#/components/schemas/UserMessage" }, { "$ref": "#/components/schemas/AssistantMessage" }, { "$ref": "#/components/schemas/ToolMessage" } ] }, "minItems": 1, "examples": [ [{ "role": "user", "content": "create a poem using palindromes" }] ] }, "max_tokens": { "title": "Max Tokens", "type": "integer", "description": "The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.", "nullable": true, "example": 2048 }, "max_completion_tokens": { "title": "Max Completion Tokens", "type": "integer", "description": "The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.", "nullable": true, "example": 2048 }, "temperature": { "title": "Temperature", "type": "number", "description": "What sampling temperature to use, determines the degree of randomness in the response. between 0 and 2, Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. Is recommended altering this, top_p or top_k but not more than one of these.", "minimum": 0, "maximum": 2, "default": 0.7, "nullable": true, "example": 0.7 }, "top_p": { "title": "Top P", "type": "number", "description": "Cumulative probability for token choices. An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. Is recommended altering this, top_k or temperature but not more than one of these.", "minimum": 0, "maximum": 1, "nullable": true, "example": 1 }, "top_k": { "title": "Top K", "type": "integer", "description": "Amount limit of token choices. An alternative to sampling with temperature, the model considers the results of the first K tokens with higher probability. So 10 means only the first 10 tokens with higher probability are considered. Is recommended altering this, top_p or temperature but not more than one of these.", "minimum": 1, "maximum": 100, "nullable": true, "example": 5 }, "presence_penalty": { "title": "Presence Penalty", "type": "number", "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. Not currently implemented; accepted for API compatibility", "maximum": 2, "minimum": -2, "default": 0, "nullable": true }, "frequency_penalty": { "title": "Frequency Penalty", "type": "number", "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. Not currently implemented; accepted for API compatibility", "maximum": 2, "minimum": -2, "default": 0 }, "do_sample": { "title": "do_sample", "type": "boolean", "description": "If true, sampling is enabled during output generation. If false, deterministic decoding is used.", "nullable": true }, "stop": { "title": "Stop", "description": "Sequences where the API will stop generating tokens. The returned text will not contain the stop sequence.", "oneOf": [ { "type": "string", "example": "\n", "nullable": true }, { "type": "array", "items": { "type": "string", "example": "[\"\\n\"]" } } ], "nullable": true }, "stream": { "title": "Stream", "type": "boolean", "description": "If set, partial message deltas will be sent. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message.", "default": false, "nullable": true }, "stream_options": { "title": "StreamOptions", "type": "object", "description": "Options for streaming response. Only set this when setting stream as true", "additionalProperties": true, "properties": { "include_usage": { "anyOf": [{ "type": "boolean" }], "title": "Include Usage", "description": "Whether to include the usage metrics in a final chunk or not", "nullable": true } }, "nullable": true }, "response_format": { "title": "Response Format", "description": "An object specifying the format that the model must output. Setting to `{ \"type\": \"json_object\"}` enables JSON mode, which will check the message the model generates is valid JSON. **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Setting to `{ \"type\": \"json_schema\", \"json_schema\": {}\"}` enables JSON schema mode, which will check the message the model generates is valid object of type . Setting to `{ \"type\": \"text\"}` is equivalent to the default plain text generation", "oneOf": [ { "$ref": "#/components/schemas/ResponseFormatJSONSchema" }, { "$ref": "#/components/schemas/ResponseFormatJSONObject" }, { "$ref": "#/components/schemas/ResponseFormatText" } ], "discriminator": { "propertyName": "type", "mapping": { "json_schema": "#/components/schemas/ResponseFormatJSONSchema", "json_object": "#/components/schemas/ResponseFormatJSONObject", "text": "#/components/schemas/ResponseFormatText" } }, "nullable": true }, "reasoning_effort": { "title": "Reasoning Effort", "type": "string", "description": "Value specifying the amount of reasoning the model is allowed to do, increasing it will increase the number of output reasoning tokens generated by the model, but will improve quality of the responses. allowed values are 'low', 'medium', 'high'", "enum": ["low", "medium", "high"], "nullable": true }, "tool_choice": { "title": "Tool Choice", "description": "Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.", "anyOf": [ { "enum": ["none", "auto", "required"], "type": "string" }, { "$ref": "#/components/schemas/ToolChoiceObject" } ], "nullable": true }, "parallel_tool_calls": { "title": "Parallel Tool Calls", "type": "boolean", "description": "Whether to enable parallel function calling during tool use.", "nullable": true }, "tools": { "title": "tools", "type": "array", "description": "A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.", "items": { "$ref": "#/components/schemas/Tool" }, "maxItems": 128, "nullable": true }, "chat_template_kwargs": { "title": "Chat Template Kwargs", "type": "object", "description": "A dictionary of additional keyword arguments to pass into the chat template. Use this to provide extra context or parameters that the model's chat template can process. Keys must be strings; values may be any valid JSON type.", "properties": { "enable_thinking": { "$ref": "#/components/schemas/EnableThinking" } }, "additionalProperties": true, "nullable": true, "example": { "enable_thinking": true } }, "logprobs": { "title": "Logprobs", "type": "boolean", "description": "Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`.", "default": false, "nullable": true }, "top_logprobs": { "title": "Top Logprobs", "type": "integer", "description": "An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used.", "maximum": 20, "minimum": 0, "nullable": true }, "n": { "title": "N", "type": "integer", "description": "How many completions to generate for each prompt.\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens`.", "maximum": 8, "minimum": 1, "default": 1, "nullable": true, "example": 1 }, "logit_bias": { "title": "Logit Bias", "type": "object", "description": "Modify the likelihood of specified tokens appearing in the generation. Accepts a JSON object that maps tokens (specified by their token ID in the model tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. Values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.", "nullable": true }, "seed": { "title": "Seed", "description": "If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.", "nullable": true, "type": "integer" } }, "required": ["model", "messages"], "examples": [ { "messages": [ { "role": "user", "content": "create a poem using palindromes" } ], "model": "gpt-oss-120b" }, { "messages": [ { "role": "system", "content": "You are a helpful assistant developed by SambaNova systems" }, { "role": "user", "content": "create a poem using palindromes" } ], "max_tokens": 2048, "model": "gpt-oss-120b", "stream": false, "temperature": 0.7, "top_p": 1 } ] }, "Usage": { "title": "Usage", "type": "object", "description": "Usage metrics for the completion, embeddings,transcription or translation request", "additionalProperties": true, "properties": { "acceptance_rate": { "title": "Acceptance Rate", "type": "number", "description": "acceptance rate" }, "completion_tokens": { "title": "Completion Tokens", "type": "integer", "description": "number of tokens generated in completion" }, "completion_tokens_after_first_per_sec": { "title": "Completion Tokens After First Per Sec", "type": "number", "description": "completion tokens per second after first token generation" }, "completion_tokens_after_first_per_sec_first_ten": { "title": "Completion Tokens After First Per Sec First Ten", "type": "number", "description": "completion tokens per second after first token generation first ten" }, "completion_tokens_after_first_per_sec_graph": { "title": "Completion Tokens After First Per Sec Graph", "type": "number", "description": "completion tokens per second after first token generation" }, "completion_tokens_per_sec": { "title": "Completion Tokens Per Sec", "type": "number", "description": "completion tokens per second" }, "end_time": { "title": "End Time", "type": "number", "description": "The Unix timestamp (in seconds) of when the generation finished." }, "is_last_response": { "title": "Is Last Response", "type": "boolean", "description": "whether or not is last response, always true for non streaming response", "const": true }, "prompt_tokens_details": { "title": "Prompt tokens details", "type": "object", "description": "Extra tokens details", "additionalProperties": true, "properties": { "cached_tokens": { "title": "Cached tokens", "description": "amount of cached tokens", "type": "integer" } } }, "prompt_tokens": { "title": "Prompt Tokens", "type": "integer", "description": "number of tokens used in the prompt sent" }, "start_time": { "title": "Start Time", "type": "number", "description": "The Unix timestamp (in seconds) of when the generation started." }, "time_to_first_token": { "title": "Time To First Token", "type": "number", "description": "also TTF, time (in seconds) taken to generate the first token" }, "time_to_first_token_graph": { "title": "Time To First Token Graph", "type": "number", "description": "Time (in seconds) to first token, adjusted for graph rendering. May differ slightly from time_to_first_token." }, "stop_reason": { "title": "Stop Reason", "type": "string", "description": "The reason generation stopped (e.g. \"stop\", \"length\"). Mirrors the choice-level finish_reason but reported at the usage level.", "nullable": true }, "completion_tokens_details": { "title": "Completion Tokens Details", "type": "object", "description": "Breakdown of completion token consumption.", "additionalProperties": true, "properties": { "reasoning_tokens": { "title": "Reasoning Tokens", "type": "integer", "description": "Number of tokens consumed by the model's internal reasoning process. Only present on reasoning-capable models." } }, "nullable": true }, "total_latency": { "title": "Total Latency", "type": "number", "description": "total time (in seconds) taken to generate the full generation" }, "total_tokens": { "title": "Total Tokens", "type": "integer", "description": "prompt tokens + completion tokens" }, "total_tokens_per_sec": { "title": "Total Tokens Per Sec", "type": "number", "description": "tokens per second including prompt and completion" } }, "nullable": true, "examples": [ { "completion_tokens": 260, "completion_tokens_after_first_per_sec": 422.79282728043336, "completion_tokens_after_first_per_sec_first_ten": 423.6108998455803, "completion_tokens_after_first_per_sec_graph": 423.6108998455803, "completion_tokens_per_sec": 314.53312043711406, "completion_tokens_details": { "reasoning_tokens": 55 }, "end_time": 1776189309.02061, "is_last_response": true, "prompt_tokens": 90, "prompt_tokens_details": { "cached_tokens": 0 }, "start_time": 1776189308.193988, "stop_reason": "stop", "time_to_first_token": 0.21402883529663086, "time_to_first_token_graph": 0.2102978229522705, "total_latency": 0.8266220092773438, "total_tokens": 350, "total_tokens_per_sec": 423.40996981919204 }, { "prompt_tokens": 43, "total_tokens": 393 } ] }, "TopLogProbs": { "title": "TopLogProbs", "type": "object", "additionalProperties": true, "properties": { "bytes": { "title": "Bytes", "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ] }, "logprob": { "title": "Logprob", "type": "number" }, "token": { "title": "Token", "type": "string" } }, "required": ["token", "logprob"], "examples": [ { "token": " Hello", "logprob": -0.00012340000000000002, "bytes": [32, 72, 101, 108, 108, 111] }, { "token": " Hi", "logprob": -8.243, "bytes": [32, 72, 105] } ] }, "LogProbsContent": { "title": "Log Probs Content", "additionalProperties": true, "properties": { "bytes": { "title": "Bytes", "anyOf": [{ "items": { "type": "integer" }, "type": "array" }], "nullable": true }, "logprob": { "title": "Logprob", "type": "number" }, "token": { "title": "Token", "type": "string" }, "top_logprobs": { "$ref": "#/components/schemas/TopLogProbs" } }, "required": ["token", "logprob", "top_logprobs"], "examples": [ { "token": " Hello", "logprob": -0.00012340000000000002, "bytes": [32, 72, 101, 108, 108, 111], "top_logprobs": [ { "token": " Hello", "logprob": -0.00012340000000000002, "bytes": [32, 72, 101, 108, 108, 111] }, { "token": " Hi", "logprob": -8.243, "bytes": [32, 72, 105] } ] } ] }, "LogProbs": { "title": "Completion Log Probs", "type": "object", "description": "Completion Log Probs object", "additionalProperties": true, "properties": { "content": { "$ref": "#/components/schemas/LogProbsContent" } }, "required": ["content"], "examples": [ { "content": [ { "token": " Hello", "logprob": -0.00012340000000000002, "bytes": [32, 72, 101, 108, 108, 111], "top_logprobs": [ { "token": " Hello", "logprob": -0.00012340000000000002, "bytes": [32, 72, 101, 108, 108, 111] }, { "token": " Hi", "logprob": -8.243, "bytes": [32, 72, 105] } ] }, { "token": "!", "logprob": -0.0023456, "bytes": [33], "top_logprobs": [ { "token": "!", "logprob": -0.0023456, "bytes": [33] }, { "token": ",", "logprob": -6.712, "bytes": [44] } ] } ] } ] }, "CompletionResponseMessage": { "title": "Completion Response Message", "type": "object", "description": "completion response message object", "additionalProperties": true, "properties": { "role": { "title": "Role", "type": "string", "description": "The role of the messages author", "enum": ["assistant", "user", "system", "tool"] }, "content": { "title": "Content", "type": "string", "description": "The contents of the assistant message.", "nullable": true }, "tool_calls": { "title": "Tool Calls", "type": "array", "items": { "$ref": "#/components/schemas/AssistantToolCall" }, "description": "The tool calls generated by the model.", "nullable": true } }, "required": ["role", "content"] }, "ChatCompletionChoice": { "title": "Chat Completion Choice", "type": "object", "additionalProperties": true, "properties": { "message": { "$ref": "#/components/schemas/CompletionResponseMessage" }, "finish_reason": { "title": "Finish Reason", "type": "string", "description": "The reason the model stopped generating tokens. Will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `tool_calls` if the model called a tool.", "enum": ["stop", "length", "tool_calls"] }, "index": { "title": "Index", "type": "integer", "description": "The index of the choice in the list of choices" }, "logprobs": { "title": "Logprobs", "anyOf": [{ "$ref": "#/components/schemas/LogProbs" }], "description": "Returns the log probability of each generated token, indicating the model's confidence. Setting logprobs=true and top_logprobs (up to 5) reveals the likelihood of chosen tokens", "nullable": true } }, "required": ["finish_reason", "index", "message"] }, "ChatCompletionResponse": { "title": "Chat Completion Response", "type": "object", "description": "chat completion response returned by the model", "properties": { "choices": { "title": "Choices", "type": "array", "items": { "$ref": "#/components/schemas/ChatCompletionChoice" }, "minItems": 1 }, "created": { "title": "Created", "type": "number", "description": "The Unix timestamp (in seconds) of when the chat completion was created." }, "id": { "title": "Id", "type": "string", "description": "A unique identifier for the chat completion." }, "model": { "title": "Model", "description": "The model used for the chat completion.", "type": "string" }, "object": { "title": "Object", "type": "string", "description": "The object type, always `chat.completion`.", "enum": ["chat.completion"], "const": "chat.completion" }, "system_fingerprint": { "title": "System fingerprint", "type": "string", "description": "Backend configuration that the model runs with." }, "usage": { "$ref": "#/components/schemas/Usage" } }, "required": [ "choices", "created", "id", "model", "object", "system_fingerprint", "usage" ], "examples": [ { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "In madam moon's silver glow, Aha, a palindrome to know, Radar spins, a circular tale, Level heads prevail, without fail. A man, a plan, a canal, Panama! Able was I ere I saw Elba, A Santa at NASA, a curious sight, Do geese see God, in the pale moonlight? Mr. Owl ate my metal worm, Do nine men interpret? Nine men, I nod, Never odd or even, a palindrome's might, Madam, in Eden, I'm Adam. Aibohphobia, a fear to confess, A palindrome's symmetry, I must address, Refer, a word that reads the same, A palindrome's beauty, in its circular game. In the stillness of the night, Ava, a palindrome, shining bright, Hannah, a name that reads the same, A palindrome's magic, in its circular flame. Note: Please keep in mind that creating a poem using palindromes can be a challenging task, and the resulting poem may not be as cohesive or flowing as one that doesn't rely on palindromes. However, I hope you enjoy the attempt!", "role": "assistant" } } ], "created": 1737583288.6076705, "id": "83a7809d-e18f-44f9-9ab7-2bc494c6c661", "model": "gpt-oss-120b", "object": "chat.completion", "system_fingerprint": "fastcoe", "usage": { "acceptance_rate": 4.058139324188232, "completion_tokens": 350, "completion_tokens_after_first_per_sec": 248.09314856382406, "completion_tokens_after_first_per_sec_first_ten": 249.67922929952655, "completion_tokens_per_sec": 238.91966176995348, "end_time": 1737583289.7345645, "is_last_response": true, "prompt_tokens": 43, "start_time": 1737583288.264706, "time_to_first_token": 0.06312894821166992, "total_latency": 1.4649275719174653, "total_tokens": 393, "total_tokens_per_sec": 268.27264878740493 } }, { "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "Hello! How can I assist you today?", "role": "assistant" }, "logprobs": { "content": [ { "token": " Hello", "logprob": -0.00012340000000000002, "bytes": [32, 72, 101, 108, 108, 111], "top_logprobs": [ { "token": " Hello", "logprob": -0.00012340000000000002, "bytes": [32, 72, 101, 108, 108, 111] }, { "token": " Hi", "logprob": -8.243, "bytes": [32, 72, 105] } ] }, { "token": "!", "logprob": -0.0023456, "bytes": [33], "top_logprobs": [ { "token": "!", "logprob": -0.0023456, "bytes": [33] }, { "token": ",", "logprob": -6.712, "bytes": [44] } ] } ] } } ], "created": 1737583290.1234567, "id": "94b8910e-f29a-55a0-0bc8-3cd505d7d772", "model": "gpt-oss-120b", "object": "chat.completion", "system_fingerprint": "fastcoe", "usage": { "acceptance_rate": 3.5, "completion_tokens": 9, "completion_tokens_after_first_per_sec": 245.3, "completion_tokens_per_sec": 230.1, "end_time": 1737583290.2345679, "is_last_response": true, "prompt_tokens": 15, "start_time": 1737583290.1234567, "time_to_first_token": 0.058, "total_latency": 0.111, "total_tokens": 24, "total_tokens_per_sec": 216.2 } } ] }, "CompletionResponseDelta": { "title": "Completion Response Delta", "type": "object", "description": "completion response delta chunk generated by streamed model responses.", "additionalProperties": true, "properties": { "role": { "title": "Role", "type": "string", "description": "The role of the messages author", "enum": ["assistant", "user", "system", "tool"], "nullable": true }, "content": { "title": "Content", "type": "string", "description": "The contents of the assistant message.", "nullable": true }, "reasoning": { "title": "Reasoning", "type": "string", "description": "Reasoning (returned by reasoning models like gpt oss)", "nullable": true }, "channel": { "title": "Channel", "type": "string", "description": "Channel (returned by reasoning models like gpt oss)", "nullable": true }, "tool_calls": { "title": "Tool Calls", "type": "array", "items": { "$ref": "#/components/schemas/AssistantToolCall" }, "description": "The tool calls generated by the model.", "nullable": true } } }, "ChatCompletionChunkChoice": { "title": "Chat Completion Chunk Choice", "type": "object", "additionalProperties": true, "properties": { "delta": { "$ref": "#/components/schemas/CompletionResponseDelta" }, "finish_reason": { "title": "Finish Reason", "type": "string", "description": "The reason the model stopped generating tokens. Will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `tool_calls` if the model called a tool.", "enum": ["stop", "length", "tool_calls"], "nullable": true }, "index": { "title": "Index", "type": "integer", "description": "The index of the choice in the list of choices" }, "logprobs": { "title": "Logprobs", "anyOf": [{ "$ref": "#/components/schemas/LogProbs" }], "description": "Returns the log probability of each generated token, indicating the model's confidence. Setting logprobs=true and top_logprobs (up to 5) reveals the likelihood of chosen tokens", "nullable": true } }, "required": ["index", "delta"] }, "ChatCompletionStreamResponse": { "title": "Chat Completion Stream Response", "type": "object", "description": "streamed chunk of a chat completion response returned by the model", "additionalProperties": true, "properties": { "choices": { "title": "Choices", "type": "array", "description": "A list of chat completion choices.", "items": { "$ref": "#/components/schemas/ChatCompletionChunkChoice" }, "minItems": 0, "nullable": true }, "created": { "title": "Created", "type": "number", "description": "The Unix timestamp (in seconds) of when the chat completion was created." }, "id": { "title": "Id", "type": "string", "description": "A unique identifier for the chat completion." }, "model": { "title": "Model", "description": "The model used for the chat completion.", "type": "string" }, "object": { "title": "Object", "type": "string", "description": "The object type, always `chat.completion.chunk`.", "enum": ["chat.completion.chunk"], "const": "chat.completion.chunk" }, "system_fingerprint": { "title": "System fingerprint", "type": "string", "description": "Backend configuration that the model runs with." }, "usage": { "$ref": "#/components/schemas/Usage" } }, "required": [ "choices", "created", "id", "model", "object", "system_fingerprint" ], "examples": [ { "choices": [ { "delta": { "role": "assistant", "content": "" }, "index": 0, "finish_reason": null, "logprobs": null } ], "created": 1737642515.6076705, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "gpt-oss-120b", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe" }, { "choices": [ { "delta": { "role": "assistant", "content": "in" }, "index": 0, "finish_reason": null, "logprobs": null } ], "created": 1737642515.6076705, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "gpt-oss-120b", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe" }, { "choices": [ { "delta": { "content": "" }, "index": 0, "finish_reason": "length", "logprobs": null } ], "created": 1737642515.6076705, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "gpt-oss-120b", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe" }, { "choices": [], "created": 1737642515.6076705, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "gpt-oss-120b", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe", "usage": { "acceptance_rate": 3, "completion_tokens": 100, "completion_tokens_after_first_per_sec": 262.2771255106759, "completion_tokens_after_first_per_sec_first_ten": 266.98193514986144, "completion_tokens_after_first_per_sec_graph": 266.98193514986144, "completion_tokens_per_sec": 217.87260449707574, "end_time": 1737642515.9077535, "is_last_response": true, "prompt_tokens": 43, "prompt_tokens_details": { "cached_tokens": 0 }, "start_time": 1737642515.4458635, "time_to_first_token": 0.0844266414642334, "total_latency": 0.4589838186899821, "total_tokens": 143, "total_tokens_per_sec": 311.55782443081836 } }, { "choices": [ { "delta": { "content": " Hello" }, "index": 0, "finish_reason": null, "logprobs": { "content": [ { "token": " Hello", "logprob": -0.00012340000000000002, "bytes": [32, 72, 101, 108, 108, 111], "top_logprobs": [ { "token": " Hello", "logprob": -0.00012340000000000002, "bytes": [32, 72, 101, 108, 108, 111] }, { "token": " Hi", "logprob": -8.243, "bytes": [32, 72, 105] } ] } ] } } ], "created": 1737642516.1076705, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30c", "model": "gpt-oss-120b", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe" } ] }, "CompletionRequest": { "title": "Completion Request", "type": "object", "description": "completions request object", "additionalProperties": true, "properties": { "model": { "title": "Model", "description": "The model ID to use (e.g. gpt-oss-120b). See available [models](https://docs.sambanova.ai/docs/en/models/sambacloud-models)", "anyOf": [ { "type": "string" }, { "enum": [ "Meta-Llama-3.3-70B-Instruct", "Meta-Llama-3.2-1B-Instruct", "Meta-Llama-3.2-3B-Instruct", "Llama-3.2-11B-Vision-Instruct", "Llama-3.2-90B-Vision-Instruct", "Meta-Llama-3.1-8B-Instruct", "Meta-Llama-3.1-70B-Instruct", "Meta-Llama-3.1-405B-Instruct", "Qwen2.5-Coder-32B-Instruct", "Qwen2.5-72B-Instruct", "QwQ-32B-Preview", "Meta-Llama-Guard-3-8B", "DeepSeek-R1", "DeepSeek-R1-0528", "DeepSeek-V3-0324", "DeepSeek-V3.1", "DeepSeek-V3.1-cb", "DeepSeek-V3.1-Terminus", "DeepSeek-V3.2", "DeepSeek-R1-Distill-Llama-70B", "Llama-4-Maverick-17B-128E-Instruct", "Llama-4-Scout-17B-16E-Instruct", "Qwen3-32B", "Qwen3-235B", "Llama-3.3-Swallow-70B-Instruct-v0.4", "gpt-oss-120b", "ALLaM-7B-Instruct-preview", "MiniMax-M2.5", "MiniMax-M2.7", "gemma-3-12b-it" ] } ] }, "prompt": { "title": "Prompt", "type": "string", "description": "Prompt to send to the model.", "examples": [ "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\nYou are a helpful assistant.<|eot_id|><|start_header_id|>user<|end_header_id|>\ncreate a poem using palindromes<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n" ] }, "max_tokens": { "title": "Max Tokens", "type": "integer", "description": "The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.", "nullable": true, "example": 2048 }, "max_completion_tokens": { "title": "Max Completion Tokens", "type": "integer", "description": "The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.", "nullable": true, "example": 2048 }, "temperature": { "title": "Temperature", "type": "number", "description": "What sampling temperature to use, determines the degree of randomness in the response. between 0 and 2, Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. Is recommended altering this, top_p or top_k but not more than one of these.", "minimum": 0, "maximum": 2, "default": 0.7, "nullable": true, "example": 0.7 }, "top_p": { "title": "Top P", "type": "number", "description": "Cumulative probability for token choices. An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. Is recommended altering this, top_k or temperature but not more than one of these.", "minimum": 0, "maximum": 1, "nullable": true, "example": 1 }, "top_k": { "title": "Top K", "type": "integer", "description": "Amount limit of token choices. An alternative to sampling with temperature, the model considers the results of the first K tokens with higher probability. So 10 means only the first 10 tokens with higher probability are considered. Is recommended altering this, top_p or temperature but not more than one of these.", "minimum": 1, "maximum": 100, "nullable": true, "example": 5 }, "presence_penalty": { "title": "Presence Penalty", "type": "number", "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. Not currently implemented; accepted for API compatibility", "maximum": 2, "minimum": -2, "default": 0, "nullable": true }, "frequency_penalty": { "title": "Frequency Penalty", "type": "number", "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. Not currently implemented; accepted for API compatibility", "maximum": 2, "minimum": -2, "default": 0 }, "do_sample": { "title": "do_sample", "type": "boolean", "description": "If true, sampling is enabled during output generation. If false, deterministic decoding is used.", "nullable": true }, "stop": { "title": "Stop", "description": "Sequences where the API will stop generating tokens. The returned text will not contain the stop sequence.", "oneOf": [ { "type": "string", "example": "\n", "nullable": true }, { "type": "array", "items": { "type": "string", "example": "[\"\\n\"]" } } ], "nullable": true }, "stream": { "title": "Stream", "type": "boolean", "description": "If set, partial message deltas will be sent. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message.", "default": false, "nullable": true }, "stream_options": { "title": "StreamOptions", "type": "object", "description": "Options for streaming response. Only set this when setting stream as true", "additionalProperties": true, "properties": { "include_usage": { "anyOf": [{ "type": "boolean" }], "title": "Include Usage", "description": "Whether to include the usage metrics in a final chunk or not", "nullable": true } }, "nullable": true }, "logprobs": { "title": "Logprobs", "type": "boolean", "description": "This is not yet supported by our models in completions API. Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`.", "default": false, "nullable": true }, "top_logprobs": { "title": "Top Logprobs", "type": "integer", "description": "This is not yet supported by our models in completions API. An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used.", "maximum": 20, "minimum": 0, "nullable": true }, "n": { "title": "N", "type": "integer", "description": "How many completions to generate for each prompt.\n**Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens`.", "maximum": 1, "minimum": 1, "default": 1, "nullable": true, "example": 1 }, "logit_bias": { "title": "Logit Bias", "type": "object", "description": "Modify the likelihood of specified tokens appearing in the generation. Accepts a JSON object that maps tokens (specified by their token ID in the model tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. Values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.", "nullable": true }, "seed": { "title": "Seed", "description": "If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\nDeterminism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.", "nullable": true, "type": "integer" } }, "required": ["model", "prompt"], "examples": [ { "prompt": "<|begin_of_text|><|start_header_id|>system<|end_header_id|> You are a helpful assistant.<|eot_id|><|start_header_id|>user<|end_header_id|> create a poem using palindromes<|eot_id|><|start_header_id|>assistant<|end_header_id|>", "max_tokens": 2048, "model": "gpt-oss-120b", "stream": false, "temperature": 0.7, "top_p": 1 } ] }, "CompletionChoice": { "title": "Completion Choice", "type": "object", "additionalProperties": true, "properties": { "message": { "$ref": "#/components/schemas/CompletionResponseMessage" }, "text": { "title": "Text", "type": "string", "description": "model response" }, "finish_reason": { "title": "Finish Reason", "type": "string", "description": "The reason the model stopped generating tokens. Will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `tool_calls` if the model called a tool.", "enum": ["stop", "length", "tool_calls"] }, "index": { "title": "Index", "type": "integer", "description": "The index of the choice in the list of choices" }, "logprobs": { "title": "Logprobs", "anyOf": [{ "$ref": "#/components/schemas/LogProbs" }], "description": "currently not supported in completions API, always null will be returned", "nullable": true } }, "required": ["finish_reason", "index", "text"] }, "CompletionResponse": { "title": "Completion Response", "type": "object", "description": "ompletion response returned by the model", "properties": { "choices": { "title": "Choices", "type": "array", "items": { "$ref": "#/components/schemas/CompletionChoice" }, "minItems": 1 }, "created": { "title": "Created", "type": "number", "description": "The Unix timestamp (in seconds) of when the chat completion was created." }, "id": { "title": "Id", "type": "string", "description": "A unique identifier for the chat completion." }, "model": { "title": "Model", "description": "The model used for the chat completion.", "type": "string" }, "object": { "title": "Object", "type": "string", "description": "The object type, always `chat.completion`.", "enum": ["chat.completion"], "const": "chat.completion" }, "system_fingerprint": { "title": "System fingerprint", "type": "string", "description": "Backend configuration that the model runs with." }, "usage": { "$ref": "#/components/schemas/Usage" } }, "required": [ "choices", "created", "id", "model", "object", "system_fingerprint", "usage" ], "examples": [ { "choices": [ { "finish_reason": "stop", "index": 0, "text": "In madam moon's silver glow, Aha, a palindrome to know, Radar spins, a circular tale, Level heads prevail, without fail. A man, a plan, a canal, Panama! Able was I ere I saw Elba, A Santa at NASA, a curious sight, Do geese see God, in the pale moonlight? Mr. Owl ate my metal worm, Do nine men interpret? Nine men, I nod, Never odd or even, a palindrome's might, Madam, in Eden, I'm Adam. Aibohphobia, a fear to confess, A palindrome's symmetry, I must address, Refer, a word that reads the same, A palindrome's beauty, in its circular game. In the stillness of the night, Ava, a palindrome, shining bright, Hannah, a name that reads the same, A palindrome's magic, in its circular flame. Note: Please keep in mind that creating a poem using palindromes can be a challenging task, and the resulting poem may not be as cohesive or flowing as one that doesn't rely on palindromes. However, I hope you enjoy the attempt!" } ], "created": 1737583288.6076705, "id": "83a7809d-e18f-44f9-9ab7-2bc494c6c661", "model": "gpt-oss-120b", "object": "chat.completion", "system_fingerprint": "fastcoe", "usage": { "acceptance_rate": 4.058139324188232, "completion_tokens": 350, "completion_tokens_after_first_per_sec": 248.09314856382406, "completion_tokens_after_first_per_sec_first_ten": 249.67922929952655, "completion_tokens_per_sec": 238.91966176995348, "end_time": 1737583289.7345645, "is_last_response": true, "prompt_tokens": 43, "start_time": 1737583288.264706, "time_to_first_token": 0.06312894821166992, "total_latency": 1.4649275719174653, "total_tokens": 393, "total_tokens_per_sec": 268.27264878740493 } } ] }, "CompletionChunkChoice": { "title": "Completion Chunk Choice", "type": "object", "additionalProperties": true, "properties": { "text": { "title": "Text", "type": "string", "description": "model generation response" }, "finish_reason": { "title": "Finish Reason", "type": "string", "description": "The reason the model stopped generating tokens. Will be `stop` if the model hit a natural stop point or a provided stop sequence, `length` if the maximum number of tokens specified in the request was reached, `tool_calls` if the model called a tool.", "enum": ["stop", "length"], "nullable": true }, "index": { "title": "Index", "type": "integer", "description": "The index of the choice in the list of choices" }, "logprobs": { "title": "Logprobs", "anyOf": [{ "$ref": "#/components/schemas/LogProbs" }], "description": "currently not supported in completions API, always null will be returned", "nullable": true } }, "required": ["text"] }, "CompletionStreamResponse": { "title": "Completion Stream Response", "type": "object", "description": "streamed chunk of a completion response returned by the model", "additionalProperties": true, "properties": { "choices": { "title": "Choices", "type": "array", "description": "A list of chat completion choices.", "items": { "$ref": "#/components/schemas/CompletionChunkChoice" }, "minItems": 0, "nullable": true }, "created": { "title": "Created", "type": "number", "description": "The Unix timestamp (in seconds) of when the chat completion was created." }, "id": { "title": "Id", "type": "string", "description": "A unique identifier for the chat completion." }, "model": { "title": "Model", "description": "The model used for the chat completion.", "type": "string" }, "object": { "title": "Object", "type": "string", "description": "The object type, always `chat.completion.chunk`.", "enum": ["chat.completion.chunk"], "const": "chat.completion.chunk" }, "system_fingerprint": { "title": "System fingerprint", "type": "string", "description": "Backend configuration that the model runs with." }, "usage": { "$ref": "#/components/schemas/Usage" } }, "required": [ "choices", "created", "id", "model", "object", "system_fingerprint" ], "examples": [ { "choices": [ { "delta": { "role": "assistant", "content": "" }, "index": 0, "finish_reason": null, "logprobs": null } ], "created": 1737642515.6076705, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "gpt-oss-120b", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe" }, { "choices": [ { "delta": { "role": "assistant", "content": "in" }, "index": 0, "finish_reason": null, "logprobs": null } ], "created": 1737642515.6076705, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "gpt-oss-120b", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe" }, { "choices": [ { "delta": { "content": "" }, "index": 0, "finish_reason": "length", "logprobs": null } ], "created": 1737642515.6076705, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "gpt-oss-120b", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe" }, { "choices": [], "created": 1737642515.6076705, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "gpt-oss-120b", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe", "usage": { "acceptance_rate": 3, "completion_tokens": 100, "completion_tokens_after_first_per_sec": 262.2771255106759, "completion_tokens_after_first_per_sec_first_ten": 266.98193514986144, "completion_tokens_after_first_per_sec_graph": 266.98193514986144, "completion_tokens_per_sec": 217.87260449707574, "end_time": 1737642515.9077535, "is_last_response": true, "prompt_tokens": 43, "prompt_tokens_details": { "cached_tokens": 0 }, "start_time": 1737642515.4458635, "time_to_first_token": 0.0844266414642334, "total_latency": 0.4589838186899821, "total_tokens": 143, "total_tokens_per_sec": 311.55782443081836 } } ] }, "ResponseTool": { "title": "Response Tool", "type": "object", "description": "A tool definition passed to the model via the tools[] array. Only type \"function\" is supported; other tool types are filtered server-side.", "properties": { "type": { "title": "Type", "type": "string", "description": "The type of tool. Always \"function\".", "enum": ["function"] }, "name": { "title": "Name", "type": "string", "description": "The name of the function to be called." }, "description": { "title": "Description", "type": "string", "description": "A description of what the function does. Used by the model to decide when and whether to call it.", "nullable": true }, "parameters": { "title": "Parameters", "type": "object", "description": "The parameters the function accepts, described as a JSON Schema object. Omit or set to null for functions that take no parameters.", "additionalProperties": true, "nullable": true }, "strict": { "title": "Strict", "type": "boolean", "description": "When true, the model is instructed to generate arguments that strictly conform to the provided JSON schema. Not currently enforced by SambaNova accepted for API compatibility and echoed back as null in the response.", "nullable": true } }, "required": ["type", "name"], "example": { "type": "function", "name": "get_weather", "description": "Get the current weather for a given location.", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" } }, "required": ["location"], "additionalProperties": false }, "strict": null } }, "ResponseNamedToolChoice": { "title": "Response Named Tool Choice", "type": "object", "description": "Forces the model to call a specific function. Pass this object as tool_choice to guarantee the model will invoke the named function.", "properties": { "type": { "title": "Type", "type": "string", "description": "The type of tool to force. Always \"function\".", "enum": ["function"] }, "name": { "title": "Name", "type": "string", "description": "The name of the function to call." } }, "required": ["type", "name"], "example": { "type": "function", "name": "get_weather" } }, "ResponseToolChoiceOption": { "title": "Response Tool Choice Option", "description": "Controls which tool (if any) the model calls. String values: \"none\" disables tool calls; \"auto\" lets the model decide; \"required\" forces at least one tool call. To force a specific function, provide a ResponseNamedToolChoice object.", "oneOf": [ { "type": "string", "title": "Tool choice mode", "description": "String shorthand for tool selection behavior.", "enum": ["none", "auto", "required"] }, { "$ref": "#/components/schemas/ResponseNamedToolChoice" } ] }, "ResponseTextFormatText": { "title": "Response Text Format Text", "type": "object", "description": "Specifies that the model should produce output as plain text. This is the default.", "additionalProperties": false, "properties": { "type": { "title": "Type", "type": "string", "description": "The format type. Always \"text\".", "enum": ["text"] } }, "required": ["type"], "example": { "type": "text" } }, "ResponseTextFormatJSONObject": { "title": "Response Text Format JSON Object", "type": "object", "description": "Specifies that the model should produce output as a raw JSON object. The model is not constrained to any specific schema.", "additionalProperties": false, "properties": { "type": { "title": "Type", "type": "string", "description": "The format type. Always \"json_object\".", "enum": ["json_object"] } }, "required": ["type"], "example": { "type": "json_object" } }, "ResponseTextFormatJSONSchema": { "title": "Response Text Format JSON Schema", "type": "object", "description": "Specifies that the model should produce structured output conforming to the provided JSON Schema. Unlike the Chat Completions API, the Responses API places name, schema, strict, and description directly on this object (not nested under a json_schema key).", "additionalProperties": false, "properties": { "type": { "title": "Type", "type": "string", "description": "The format type. Always \"json_schema\".", "enum": ["json_schema"] }, "name": { "title": "Name", "type": "string", "description": "A name for the schema, used to identify it in the model's output." }, "description": { "title": "Description", "type": "string", "description": "An optional description of the schema, used to guide the model.", "nullable": true }, "schema": { "title": "Schema", "type": "object", "description": "A JSON Schema object defining the structure the model's output must conform to. Typically includes \"type\", \"properties\", \"required\", and optionally \"additionalProperties\". Must be a valid JSON Schema.", "additionalProperties": true, "nullable": true }, "strict": { "title": "Strict", "type": "boolean", "description": "When true, the model is instructed to produce output that strictly matches the schema. Not currently enforced by SambaNova — accepted for API compatibility.", "nullable": true } }, "required": ["type", "name"], "example": { "type": "json_schema", "name": "event_extraction", "description": "Extract structured event information from text", "strict": false, "schema": { "type": "object", "properties": { "title": { "type": "string" }, "date": { "type": "string" }, "time": { "type": "string" }, "location": { "type": "string" } }, "required": ["title", "date", "time", "location"], "additionalProperties": false } } }, "ResponseFormatConfiguration": { "title": "Response Format Configuration", "description": "Controls the format of the model's output for the Responses API text.format field. \"text\" returns plain text (default). \"json_object\" returns a raw JSON object. \"json_schema\" enforces structured output matching a provided JSON Schema definition (fields are flat — no json_schema wrapper key).", "oneOf": [ { "$ref": "#/components/schemas/ResponseTextFormatText" }, { "$ref": "#/components/schemas/ResponseTextFormatJSONObject" }, { "$ref": "#/components/schemas/ResponseTextFormatJSONSchema" } ], "discriminator": { "propertyName": "type", "mapping": { "text": "#/components/schemas/ResponseTextFormatText", "json_object": "#/components/schemas/ResponseTextFormatJSONObject", "json_schema": "#/components/schemas/ResponseTextFormatJSONSchema" } } }, "ResponseUrlCitation": { "title": "Response URL Citation", "type": "object", "description": "A URL citation annotation on an output text span. Not currently implemented by SambaNova — included for OpenAI API compatibility.", "properties": { "type": { "title": "Type", "type": "string", "description": "The annotation type. Always \"url_citation\".", "enum": ["url_citation"] }, "url": { "title": "URL", "type": "string", "description": "The URL being cited." }, "title": { "title": "Title", "type": "string", "description": "The title of the cited page.", "nullable": true }, "start_index": { "title": "Start Index", "type": "integer", "description": "Character offset in the output text where the citation starts." }, "end_index": { "title": "End Index", "type": "integer", "description": "Character offset in the output text where the citation ends." } }, "required": ["type", "url", "start_index", "end_index"] }, "ResponseFileCitation": { "title": "Response File Citation", "type": "object", "description": "A file citation annotation on an output text span. Not currently implemented by SambaNova — included for OpenAI API compatibility.", "properties": { "type": { "title": "Type", "type": "string", "description": "The annotation type. Always \"file_citation\".", "enum": ["file_citation"] }, "file_id": { "title": "File ID", "type": "string", "description": "The ID of the cited file." }, "start_index": { "title": "Start Index", "type": "integer", "description": "Character offset in the output text where the citation starts." }, "end_index": { "title": "End Index", "type": "integer", "description": "Character offset in the output text where the citation ends." } }, "required": ["type", "file_id", "start_index", "end_index"] }, "ResponseAnnotation": { "title": "Response Annotation", "description": "An annotation on a span of output text. Currently stubbed for OpenAI API compatibility — SambaNova does not produce annotations.", "oneOf": [ { "$ref": "#/components/schemas/ResponseUrlCitation" }, { "$ref": "#/components/schemas/ResponseFileCitation" } ], "discriminator": { "propertyName": "type", "mapping": { "url_citation": "#/components/schemas/ResponseUrlCitation", "file_citation": "#/components/schemas/ResponseFileCitation" } } }, "ResponseTextContent": { "title": "Response Input Text Content", "type": "object", "description": "A plain text content part for use inside a ResponseMessage.", "properties": { "type": { "title": "Type", "type": "string", "description": "The type of this content part. \"input_text\" for user, developer, and system roles, and output_text for assistant messages.", "enum": ["input_text", "output_text"] }, "text": { "title": "Text", "type": "string", "description": "The text content of this part." }, "annotations": { "title": "Annotations", "type": "array", "description": "Annotations on spans of this text part, such as URL or file citations. Only present on output_text parts returned by the server. Not currently produced by SambaNova — included for OpenAI API compatibility.", "items": { "$ref": "#/components/schemas/ResponseAnnotation" }, "nullable": true }, "logprobs": { "title": "Log Probs", "type": "array", "description": "Log probability information for the output tokens. Only present on output_text parts when `top_logprobs` is set on the request.", "items": { "$ref": "#/components/schemas/LogProbsContent" }, "nullable": true } }, "required": ["type", "text"] }, "ResponseImageContent": { "title": "Response Image Content", "type": "object", "description": "An image content part for use inside a ResponseMessage. Supported in input messages (user role). Provide a base64-encoded image as a data URL. external URLs not supported.", "properties": { "type": { "title": "Type", "type": "string", "description": "The type of this content part. Always \"input_image\".", "enum": ["input_image"] }, "image_url": { "title": "Image URL", "type": "string", "description": "A base64-encoded image in data URL format or fully qualified URL (e.g. \"data:image/png;base64,...\"). Currently only base64-encoded image data is supported.", "nullable": true }, "detail": { "title": "Detail", "type": "string", "description": "The detail level for image processing. \"auto\" lets the model decide. \"low\" uses a fixed low-res tile. \"high\" enables high-res tiling.", "enum": ["auto", "low", "high"], "default": "auto", "nullable": true } }, "required": ["type", "image_url"] }, "ResponseAudioContent": { "title": "Response Audio Content", "type": "object", "description": "An audio content part for use inside a ResponseMessage. Supported in input messages (user role). Provide base64-encoded audio data with the format.", "properties": { "type": { "title": "Type", "type": "string", "description": "The type of this content part. Always \"input_audio\".", "enum": ["input_audio"] }, "input_audio": { "title": "Input Audio", "type": "object", "description": "The audio data and format.", "properties": { "data": { "title": "Data", "type": "string", "description": "Base64-encoded audio data." }, "format": { "title": "Format", "type": "string", "enum": ["mp3", "wav"], "description": "The format of the audio data." } }, "required": ["data", "format"] } }, "required": ["type", "input_audio"] }, "ResponseVideoContent": { "title": "Response Video Content", "type": "object", "description": "A video content part for use inside a ResponseMessage. Supported in input messages (user role). Provide a URL or base64-encoded video data.", "properties": { "type": { "title": "Type", "type": "string", "description": "The type of this content part. Always \"input_video\".", "enum": ["input_video"] }, "video_url": { "title": "Video URL", "type": "string", "description": "A URL of the video or base64-encoded video data in data URL format (e.g. \"data:video/mp4;base64,...\")." } }, "required": ["type", "video_url"] }, "ResponseReasoningContent": { "title": "Response Reasoning Content", "type": "object", "description": "A single content part within a reasoning item's content[]. Contains the raw reasoning text produced by the model during its internal thinking process.", "properties": { "type": { "title": "Type", "type": "string", "description": "The type of this reasoning content part. Always \"reasoning_text\".", "enum": ["reasoning_text"] }, "text": { "title": "Text", "type": "string", "description": "The raw reasoning text generated by the model." } }, "required": ["type", "text"], "example": { "type": "reasoning_text", "text": "The user is asking about the weather. I should call the get_weather function with the location extracted from the message." } }, "ResponseContent": { "title": "Response Content", "description": "A typed content part used in both input and output message content arrays. Discriminated by the \"type\" field.", "oneOf": [ { "$ref": "#/components/schemas/ResponseTextContent" }, { "$ref": "#/components/schemas/ResponseImageContent" }, { "$ref": "#/components/schemas/ResponseAudioContent" }, { "$ref": "#/components/schemas/ResponseVideoContent" } ], "discriminator": { "propertyName": "type", "mapping": { "input_text": "#/components/schemas/ResponseTextContent", "output_text": "#/components/schemas/ResponseTextContent", "input_image": "#/components/schemas/ResponseImageContent", "input_audio": "#/components/schemas/ResponseAudioContent", "input_video": "#/components/schemas/ResponseVideoContent" } } }, "ResponseMessage": { "title": "Response Message", "type": "object", "description": "A message item. When used as input, id and status are optional. When present in output[], id and status are always set by the server. Role \"assistant\" with content type \"output_text\" represents a prior model turn; user/system/developer turns use content type \"input_text\". Plain string content is accepted in all roles on input.", "properties": { "type": { "title": "Type", "type": "string", "description": "The type of this item. Always \"message\".", "enum": ["message"], "nullable": true }, "id": { "title": "ID", "type": "string", "description": "Unique identifier for this message item. Always present on output items returned by the server. Not required when constructing input items.", "nullable": true }, "role": { "title": "Role", "type": "string", "description": "The role of the message. \"assistant\" is set by the server on output items. All four values are valid when constructing input items.", "enum": ["user", "assistant", "system", "developer"] }, "content": { "title": "Content", "description": "The message content. Either a plain text string or an array of typed content parts. For assistant turns, array parts use type \"output_text\"; for user/system/developer turns, array parts use type \"input_text\".", "oneOf": [ { "type": "string", "title": "Text content", "description": "A plain text message body." }, { "type": "array", "title": "Content part array", "description": "An array of typed content parts.", "items": { "$ref": "#/components/schemas/ResponseContent" } } ] }, "status": { "title": "Status", "type": "string", "description": "Processing state of this item. Always set on output items returned by the server. Not required when constructing input items.", "enum": ["in_progress", "completed", "incomplete"] } }, "required": ["type", "role", "content"], "examples": [ { "type": "message", "role": "user", "content": "What is the weather in San Francisco?" }, { "type": "message", "role": "user", "content": [ { "type": "input_text", "text": "Describe what you see in this image." } ] }, { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "The weather in San Francisco is 65°F and partly cloudy." } ] }, { "type": "message", "role": "system", "content": "You are a helpful assistant that provides weather information." }, { "type": "message", "role": "developer", "content": "Always respond in JSON format when asked for structured data." } ] }, "ResponseFunctionCall": { "title": "Response Function Call", "type": "object", "description": "A function call item used in both input[] and output[]. When present in output[], the model is requesting a tool call — id and status are always set by the server. When used in input[], it replays a prior function call from the conversation history for multi-turn tool loops.", "properties": { "type": { "title": "Type", "type": "string", "description": "The type of this item. Always \"function_call\".", "enum": ["function_call"] }, "id": { "title": "ID", "type": "string", "description": "Unique identifier for this function call item. Always present on output items returned by the server. Required when replaying this item in a subsequent input[].", "nullable": true }, "call_id": { "title": "Call ID", "type": "string", "description": "The call ID generated by the model for this tool invocation. Used to correlate the function call with its corresponding function_call_output result." }, "name": { "title": "Name", "type": "string", "description": "The name of the function the model wants to call." }, "arguments": { "title": "Arguments", "type": "string", "description": "A JSON string of the arguments to pass to the function, as generated by the model. Validate the arguments in your code before calling the function — the model may hallucinate parameters not defined in the schema." }, "status": { "title": "Status", "type": "string", "description": "Processing state of this item. Always set on output items returned by the server. Not required when constructing input items.", "enum": ["in_progress", "completed", "incomplete"], "nullable": true } }, "required": ["type", "call_id", "name", "arguments"], "example": { "type": "function_call", "id": "fc_abc123", "call_id": "call_abc123", "name": "get_weather", "arguments": "{\"location\":\"San Francisco, CA\"}", "status": "completed" } }, "ResponseOutputReasoning": { "title": "Response Output Reasoning", "type": "object", "description": "A reasoning item emitted in output[] by models that expose their internal chain-of-thought. Contains the raw reasoning text the model produced before generating its final answer.", "properties": { "type": { "title": "Type", "type": "string", "description": "The type of this output item. Always \"reasoning\".", "enum": ["reasoning"] }, "id": { "title": "ID", "type": "string", "description": "Unique identifier for this reasoning item, assigned by the server.", "nullable": true }, "status": { "title": "Status", "type": "string", "description": "Processing state of this item. \"in_progress\" while streaming; \"completed\" when the full reasoning text has been emitted.", "enum": ["in_progress", "completed", "incomplete"], "nullable": true }, "content": { "title": "Content", "type": "array", "description": "The reasoning content parts. Each part has type \"reasoning_text\" and carries the raw thinking text. Absent when the item is first added (`response.output_item.added`); populated by `response.output_item.done`.", "items": { "$ref": "#/components/schemas/ResponseReasoningContent" }, "nullable": true }, "summary": { "title": "Summary", "type": "array", "description": "A condensed summary of the reasoning content. Always returned as an empty array. Included for OpenAI API compatibility.", "items": { "type": "object", "additionalProperties": true }, "nullable": true } }, "required": ["type"], "example": { "type": "reasoning", "id": "rs_msg_5dc0dc6fca844a20885869634cd3014a", "status": "completed", "summary": [], "content": [ { "type": "reasoning_text", "text": "The user wants weather information for San Francisco. I'll call get_weather with location \"San Francisco, CA\"." } ] } }, "ResponseFunctionCallOutput": { "title": "Response Function Call Output", "type": "object", "description": "A tool result item used in input[] to return the output of a function call back to the model. Always input-only — the model never outputs function_call_output items. The call_id must match the id of the corresponding ResponseFunctionCall item from the prior model turn.", "properties": { "type": { "title": "Type", "type": "string", "enum": ["function_call_output"], "description": "The type of this item. Always \"function_call_output\"." }, "id": { "title": "ID", "type": "string", "description": "Optional identifier for this output item.", "nullable": true }, "call_id": { "title": "Call ID", "type": "string", "description": "The call_id of the ResponseFunctionCall item this result corresponds to. Must match exactly." }, "output": { "title": "Output", "type": "string", "description": "A JSON string containing the result of the function call. Returned to the model as the tool's response." }, "status": { "title": "Status", "type": "string", "enum": ["in_progress", "completed", "incomplete"], "description": "Processing state. Optional when constructing input items.", "nullable": true } }, "required": ["type", "call_id", "output"], "example": { "type": "function_call_output", "call_id": "call_abc123", "output": "{\"temperature\":\"65°F\",\"condition\":\"partly cloudy\"}" } }, "ResponseInputItem": { "title": "Response Input Item", "description": "A single item in the input[] array. Can be a message, a function call, a function call result, or a reasoning trace replayed from a prior turn. When building multi-turn conversations, pass all items from the previous response output[] back as input[] items (including reasoning items) so the model has full context. Discriminated by the \"type\" field.", "oneOf": [ { "$ref": "#/components/schemas/ResponseMessage" }, { "$ref": "#/components/schemas/ResponseFunctionCall" }, { "$ref": "#/components/schemas/ResponseFunctionCallOutput" }, { "$ref": "#/components/schemas/ResponseOutputReasoning" } ], "discriminator": { "propertyName": "type", "mapping": { "message": "#/components/schemas/ResponseMessage", "function_call": "#/components/schemas/ResponseFunctionCall", "function_call_output": "#/components/schemas/ResponseFunctionCallOutput", "reasoning": "#/components/schemas/ResponseOutputReasoning" } } }, "ResponseRequest": { "title": "Response Request", "type": "object", "description": "responses request object", "additionalProperties": true, "properties": { "model": { "title": "Model", "description": "The model ID to use (e.g. gpt-oss-120b). See available [models](https://docs.sambanova.ai/docs/en/models/sambacloud-models)", "anyOf": [ { "type": "string" }, { "enum": ["gpt-oss-120b", "MiniMax-M2.5", "MiniMax-M2.7"] } ] }, "input": { "title": "Input", "description": "Text input to the model, or a structured list of input items representing the full conversation turn. A plain string is equivalent to a single user message.", "oneOf": [ { "type": "string", "title": "Text input", "description": "A plain text input equivalent to a user-role message." }, { "type": "array", "title": "Input item list", "description": "An ordered list of input items (messages, tool calls, tool results, etc.).", "items": { "$ref": "#/components/schemas/ResponseInputItem" }, "examples": [ [ { "role": "user", "content": "What is the weather in San Francisco?" }, { "role": "assistant", "content": [ { "type": "output_text", "text": "The weather in San Francisco is 65°F and partly cloudy." } ] }, { "role": "user", "content": "What should I wear?" } ], [ { "role": "user", "content": "What is the weather in San Francisco?" }, { "type": "function_call", "id": "fc_abc123", "call_id": "call_abc123", "name": "get_weather", "arguments": "{\"location\":\"San Francisco, CA\"}", "status": "completed" }, { "type": "function_call_output", "call_id": "call_abc123", "output": "{\"temperature\":\"65°F\",\"condition\":\"partly cloudy\"}" } ] ] } ] }, "instructions": { "title": "Instructions", "type": "string", "description": "Inserts a system (or developer) message as the first item in the model's context. Equivalent to a system-role message prepended to input[].", "nullable": true }, "stream": { "title": "Stream", "type": "boolean", "description": "If true, the response is delivered as server-sent events (SSE).", "default": false, "nullable": true }, "max_output_tokens": { "title": "Max Output Tokens", "type": "integer", "description": "Upper bound on the number of tokens the model may generate, including visible output tokens and reasoning tokens.", "nullable": true, "example": 1024 }, "temperature": { "title": "Temperature", "type": "number", "description": "Controls randomness in generation. Range: 0–2. It is recommended to alter this, top_p, or top_k but not more than one at a time.", "minimum": 0, "maximum": 2, "default": 0.7, "nullable": true, "example": 0.7 }, "top_p": { "title": "Top P", "type": "number", "description": "Nucleus sampling cutoff. Range: 0–1. It is recommended to alter this, temperature, or top_k but not more than one at a time.", "minimum": 0, "maximum": 1, "default": 1, "nullable": true, "example": 1 }, "top_k": { "title": "Top K", "type": "integer", "description": "Limits sampling to the top K most probable tokens. It is recommended to alter this, top_p, or temperature but not more than one at a time.", "minimum": 1, "maximum": 100, "nullable": true, "example": 5 }, "top_logprobs": { "title": "Top Logprobs", "description": "Number of top log-probability entries to return per output token. Null means log probabilities are not returned.", "type": "integer", "nullable": true }, "frequency_penalty": { "title": "Frequency Penalty", "type": "number", "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. Not currently implemented; accepted for API compatibility and echoed in the response.", "minimum": -2, "maximum": 2, "default": 0, "nullable": true }, "presence_penalty": { "title": "Presence Penalty", "type": "number", "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. Not currently implemented; accepted for API compatibility and echoed in the response.", "minimum": -2, "maximum": 2, "default": 0, "nullable": true }, "tools": { "title": "Tools", "type": "array", "description": "Tools available to the model. Only type: \"function\" is supported; all other tool types are filtered server-side.", "items": { "$ref": "#/components/schemas/ResponseTool" }, "nullable": true, "maxItems": 128 }, "parallel_tool_calls": { "title": "Parallel Tool Calls", "type": "boolean", "description": "Whether the model may issue multiple tool calls in parallel within one turn.", "default": true, "nullable": true }, "max_tool_calls": { "title": "Max Tool Calls", "type": "integer", "description": "Maximum number of tool calls the model may make in a single response turn. Not currently implemented; accepted for API compatibility.", "nullable": true }, "tool_choice": { "$ref": "#/components/schemas/ResponseToolChoiceOption" }, "text": { "title": "Text", "type": "object", "description": "Response format configuration. Supports plain text, json_object, and json_schema.", "properties": { "format": { "$ref": "#/components/schemas/ResponseFormatConfiguration" } } }, "reasoning": { "title": "Reasoning", "type": "object", "description": "Reasoning configuration for models that support it. Ignored on non-reasoning models.", "properties": { "effort": { "title": "Effort", "type": "string", "enum": ["low", "medium", "high"], "default": "medium", "nullable": true, "description": "Reasoning effort level. \"low\" is faster with less depth; \"high\" is deeper at higher token cost." } }, "nullable": true }, "user": { "title": "User", "type": "string", "description": "Included for API compatibility, but only echoed back in response ", "nullable": true }, "metadata": { "title": "Metadata", "type": "object", "description": "Included for API compatibility, but not supported", "nullable": true, "additionalProperties": { "type": "string" } }, "store": { "title": "Store", "type": "boolean", "description": "SambaNova is stateless - this field is accepted for API compatibility but has no effect. Always echoed back as false.", "default": false, "nullable": true }, "truncation": { "title": "Truncation", "type": "string", "description": "Accepted for API compatibility and echoed in the response. Context truncation behavior is not currently configurable via this field in SambaNova.", "enum": ["auto", "disabled"], "default": "disabled", "nullable": true }, "previous_response_id": { "title": "Previous Response ID", "type": "string", "description": "Not supported. SambaNova is stateless and does not maintain server-side conversation state. Accepted for API compatibility but ignored; clients must supply the full conversation history in input[].", "nullable": true }, "background": { "title": "Background", "type": "boolean", "description": "Accepted for API compatibility and echoed back in the response. Has no effect on server behavior.", "nullable": true }, "service_tier": { "title": "Service Tier", "type": "string", "description": "Accepted for API compatibility and echoed back in the response. Has no effect on server behavior.", "nullable": true } }, "required": ["model", "input"] }, "ResponseUsage": { "title": "Response Usage", "type": "object", "description": "Token usage statistics for this response.", "properties": { "input_tokens": { "title": "Input Tokens", "type": "integer", "description": "Number of tokens in the input, including conversation history and any system instructions." }, "output_tokens": { "title": "Output Tokens", "type": "integer", "description": "Number of tokens generated in the output, including visible text and any reasoning tokens." }, "total_tokens": { "title": "Total Tokens", "type": "integer", "description": "Total tokens consumed by this request (input + output)." }, "input_tokens_details": { "title": "Input Tokens Details", "type": "object", "description": "Breakdown of input token consumption.", "properties": { "cached_tokens": { "title": "Cached Tokens", "type": "integer", "description": "Number of input tokens served from the prompt cache. Cached tokens are billed at a reduced rate." } }, "nullable": true }, "output_tokens_details": { "title": "Output Tokens Details", "type": "object", "description": "Breakdown of output token consumption.", "properties": { "reasoning_tokens": { "title": "Reasoning Tokens", "type": "integer", "description": "Number of tokens consumed by the model's internal reasoning process. Only present on reasoning-capable models." } }, "nullable": true }, "start_time": { "title": "Start Time", "type": "number", "description": "Unix timestamp (seconds) of when generation started.", "nullable": true }, "end_time": { "title": "End Time", "type": "number", "description": "Unix timestamp (seconds) of when generation finished.", "nullable": true }, "time_to_first_token": { "title": "Time To First Token", "type": "number", "description": "Time in seconds from request receipt to first output token (TTFT).", "nullable": true }, "total_latency": { "title": "Total Latency", "type": "number", "description": "Total time in seconds taken to generate the full response.", "nullable": true }, "output_tokens_per_sec": { "title": "Output Tokens Per Sec", "type": "number", "description": "Output token throughput (tokens/second) for this response.", "nullable": true }, "output_tokens_after_first_per_sec": { "title": "Output Tokens After First Per Sec", "type": "number", "description": "Output token throughput measured after the first token was emitted. Excludes the time-to-first-token latency from the rate calculation.", "nullable": true }, "total_tokens_per_sec": { "title": "Total Tokens Per Sec", "type": "number", "description": "Total token throughput (input + output tokens/second).", "nullable": true }, "acceptance_rate": { "title": "Acceptance Rate", "type": "number", "description": "Speculative decoding acceptance rate. Ratio of draft tokens accepted by the verifier model. Higher values indicate better speculation efficiency.", "nullable": true }, "is_last_response": { "title": "Is Last Response", "type": "boolean", "description": "Always true for non-streaming responses. For streaming, true only on the final chunk that carries usage.", "nullable": true } }, "required": ["input_tokens", "output_tokens", "total_tokens"], "example": { "input_tokens": 248, "output_tokens": 72, "total_tokens": 320, "input_tokens_details": { "cached_tokens": 0 }, "output_tokens_details": { "reasoning_tokens": 18 }, "start_time": 1737642515.445, "end_time": 1737642515.904, "time_to_first_token": 0.084, "total_latency": 0.459, "output_tokens_per_sec": 156.8, "output_tokens_after_first_per_sec": 161.2, "total_tokens_per_sec": 311.6, "acceptance_rate": 4.06, "is_last_response": true } }, "ResponseOutputItem": { "title": "Response Output Item", "description": "A single item in the output[] array returned by the model. Can be a message (with text or tool call content), a function call request, or a reasoning trace. Discriminated by the \"type\" field.", "oneOf": [ { "$ref": "#/components/schemas/ResponseMessage" }, { "$ref": "#/components/schemas/ResponseFunctionCall" }, { "$ref": "#/components/schemas/ResponseOutputReasoning" } ], "discriminator": { "propertyName": "type", "mapping": { "message": "#/components/schemas/ResponseMessage", "function_call": "#/components/schemas/ResponseFunctionCall", "reasoning": "#/components/schemas/ResponseOutputReasoning" } } }, "ResponseResponse": { "title": "Response Response", "type": "object", "description": "A response object returned by POST /responses (non-streaming). Contains the model's output items, echoed input parameters, lifecycle metadata, and token usage.", "properties": { "id": { "title": "ID", "type": "string", "description": "Unique identifier for this response." }, "object": { "title": "Object", "type": "string", "description": "The object type. Always \"response\".", "enum": ["response"] }, "status": { "title": "Status", "type": "string", "description": "Lifecycle status of the response. \"completed\" means the model finished successfully. \"failed\" means an error occurred during generation. \"incomplete\" means generation was cut short (e.g. max_output_tokens reached).", "enum": ["completed", "failed", "in_progress", "incomplete"] }, "created_at": { "title": "Created At", "type": "integer", "description": "Unix timestamp (seconds) when the response was created." }, "completed_at": { "title": "Completed At", "type": "integer", "description": "Unix timestamp (seconds) when the response finished generating.", "nullable": true }, "model": { "title": "Model", "type": "string", "description": "The model ID used to generate this response." }, "output": { "title": "Output", "type": "array", "description": "Ordered array of output items generated by the model. Items may be of type \"message\", \"reasoning\", or \"function_call\".", "items": { "$ref": "#/components/schemas/ResponseOutputItem" } }, "usage": { "$ref": "#/components/schemas/ResponseUsage" }, "error": { "title": "Error", "type": "object", "description": "In-band error object present when status is \"failed\". Null when the response completed successfully.", "properties": { "code": { "title": "Code", "type": "string", "description": "The error code." }, "message": { "title": "message", "type": "string", "description": "A human-readable error message." } }, "nullable": true, "required": ["code", "message"] }, "incomplete_details": { "title": "Incomplete Details", "type": "object", "description": "Present when status is \"incomplete\". Describes why generation stopped before completion (e.g. max_output_tokens reached).", "properties": { "reason": { "type": "string", "description": "The reason why the response is incomplete." } }, "nullable": true }, "instructions": { "title": "Instructions", "type": "string", "description": "The system instructions echoed from the request, or null if none were provided.", "nullable": true }, "temperature": { "title": "Temperature", "type": "number", "description": "The temperature value used for this response.", "nullable": true }, "top_p": { "title": "Top P", "type": "number", "description": "The top_p value used for this response.", "nullable": true }, "top_k": { "title": "Top K", "type": "integer", "description": "The top_k value used for this response.", "nullable": true }, "frequency_penalty": { "title": "Frequency Penalty", "type": "number", "description": "The frequency_penalty value echoed from the request. Not currently implemented; accepted for API compatibility", "nullable": true }, "presence_penalty": { "title": "Presence Penalty", "type": "number", "description": "The presence_penalty value echoed from the request. Not currently implemented; accepted for API compatibility", "nullable": true }, "tools": { "title": "Tools", "type": "array", "description": "Tool definitions available to the model for this response.", "items": { "$ref": "#/components/schemas/ResponseTool" } }, "parallel_tool_calls": { "title": "Parallel Tool Calls", "type": "boolean", "description": "Whether parallel tool calls were enabled." }, "max_tool_calls": { "title": "Max Tool Calls", "type": "integer", "description": "The max_tool_calls value echoed from the request.", "nullable": true }, "tool_choice": { "$ref": "#/components/schemas/ResponseToolChoiceOption" }, "text": { "title": "Text", "type": "object", "description": "The text format configuration (structured output mode) used for this response. ", "properties": { "format": { "$ref": "#/components/schemas/ResponseFormatConfiguration" } } }, "reasoning": { "title": "Reasoning", "type": "object", "description": "The reasoning configuration used for this response.", "properties": { "effort": { "title": "Effort", "type": "string", "description": "The reasoning effort level that was applied for supported models.", "enum": ["low", "medium", "high"], "nullable": true }, "summary": { "title": "Summary", "type": "string", "description": "Not supported.", "nullable": true } }, "nullable": true }, "truncation": { "title": "Truncation", "type": "string", "description": "The truncation value echoed from the request.", "enum": ["auto", "disabled"], "nullable": true }, "background": { "title": "Background", "type": "boolean", "description": "Whether background generation was requested.", "nullable": true }, "metadata": { "title": "Metadata", "type": "object", "description": "The metadata echoed from the request.", "nullable": true, "additionalProperties": { "type": "string" } }, "max_output_tokens": { "title": "Max Output Tokens", "type": "integer", "description": "The max_output_tokens limit echoed from the request.", "nullable": true }, "top_logprobs": { "title": "Top Logprobs", "type": "integer", "description": "The top_logprobs value echoed from the request.", "nullable": true }, "previous_response_id": { "title": "Previous Response ID", "type": "string", "description": "Not supported. Always null. SambaNova is stateless; use input[] to supply full conversation history.", "nullable": true }, "store": { "title": "Store", "type": "boolean", "description": "Whether the response was stored server-side. SambaNova is stateless - always false.", "nullable": true }, "service_tier": { "title": "Service Tier", "type": "string", "description": "The service tier used to process this request, as reported by the server.", "nullable": true }, "user": { "title": "User", "type": "string", "description": "The user, echoed back from request.", "nullable": true } }, "required": [ "id", "object", "status", "created_at", "model", "output", "tools", "tool_choice", "truncation", "parallel_tool_calls", "background", "metadata", "temperature", "top_p", "store", "service_tier", "error", "incomplete_details", "frequency_penalty", "presence_penalty", "user" ], "examples": [ { "id": "resp_18cb0a9a457241f5b0383ebeee31b80d", "object": "response", "created_at": 1775853213, "completed_at": 1775853214, "status": "completed", "model": "gpt-oss-120b", "output": [ { "id": "rs_d608e0328e6340a69919f808ee38df6c", "type": "reasoning", "status": "completed", "summary": [], "content": [ { "type": "reasoning_text", "text": "User wants a three-sentence bedtime story about a unicorn. Provide three sentences, gentle, bedtime. Should be concise." } ] }, { "id": "msg_c1eb06dccbc64f469533bb51be664a9e", "type": "message", "role": "assistant", "status": "completed", "content": [ { "type": "output_text", "annotations": [], "logprobs": [], "text": "Under a moonlit canopy of twinkling stars, a silver-mane unicorn tiptoed into the meadow, leaving a trail of soft, glowing stardust behind each gentle step. She whispered a lullaby to the sleepy flowers, and they swayed in rhythm, their petals folding like tiny blankets around the night. As the world hushed, the unicorn curled around a sleepy child's dream, gifting them a night of sweet, sparkling adventures until sunrise." } ] } ], "usage": { "input_tokens": 78, "output_tokens": 126, "total_tokens": 204, "input_tokens_details": { "cached_tokens": 0 }, "output_tokens_details": { "reasoning_tokens": 48 } }, "error": null, "incomplete_details": null, "instructions": null, "metadata": {}, "parallel_tool_calls": true, "tool_choice": "auto", "tools": [], "temperature": 1, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0, "reasoning": { "effort": "medium", "summary": null }, "text": { "format": { "type": "text" } }, "truncation": "disabled", "store": false, "background": false, "service_tier": "free", "user": null, "previous_response_id": null }, { "id": "resp_e8e3ad78db7546ce969f79b0828f3be3", "object": "response", "created_at": 1775856350, "completed_at": 1775856350, "status": "completed", "model": "gpt-oss-120b", "output": [ { "id": "rs_c512ec8087b247b0962b64b7595c92d2", "type": "reasoning", "status": "completed", "summary": [], "content": [ { "type": "reasoning_text", "text": "User asks: \"What is the weather in Bogotá?\" Need to fetch current weather using function get_weather. Provide city name \"Bogotá\". Use function." } ] }, { "id": "fc_c839dacb61a54c10b6560ad8d161f004", "type": "function_call", "call_id": "call_e52f086a16c94fa796", "name": "get_weather", "arguments": "{\"city\":\"Bogotá\"}", "status": "completed" } ], "usage": { "input_tokens": 128, "output_tokens": 59, "total_tokens": 187, "input_tokens_details": { "cached_tokens": 0 }, "output_tokens_details": { "reasoning_tokens": 43 } }, "error": null, "incomplete_details": null, "instructions": null, "metadata": {}, "parallel_tool_calls": true, "tool_choice": "auto", "tools": [ { "type": "function", "name": "get_weather", "description": "Get the current weather for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] }, "strict": null } ], "temperature": 1, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0, "reasoning": { "effort": "medium", "summary": null }, "text": { "format": { "type": "text" } }, "truncation": "disabled", "store": false, "background": false, "service_tier": "free", "user": null, "previous_response_id": null }, { "id": "resp_673393d2de28449581eb6190a8168f84", "object": "response", "created_at": 1775517028, "completed_at": 1775517028, "status": "completed", "model": "gpt-oss-120b", "output": [ { "id": "rs_0c34dec41df941b2bce83e11a7614d31", "type": "reasoning", "status": "completed", "summary": [], "content": [ { "type": "reasoning_text", "text": "The user wants to extract event info from a sentence. We need to output a JSON in the prescribed format." } ] }, { "id": "msg_3b1e13019bd84ebcbcf0c15f45f91dfe", "type": "message", "role": "assistant", "status": "completed", "content": [ { "type": "output_text", "annotations": [], "logprobs": [], "text": "{\n \"title\": \"SambaNova demo\",\n \"date\": \"2026-04-18\",\n \"time\": \"15:30\",\n \"location\": \"San Francisco\"\n}\n" } ] } ], "usage": { "input_tokens": 131, "output_tokens": 280, "total_tokens": 411, "input_tokens_details": { "cached_tokens": 0 }, "output_tokens_details": { "reasoning_tokens": 18 } }, "error": null, "incomplete_details": null, "instructions": null, "metadata": {}, "parallel_tool_calls": true, "tool_choice": "auto", "tools": [], "temperature": 1, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0, "reasoning": { "effort": "medium", "summary": null }, "text": { "format": { "type": "json_schema", "name": "event_extraction", "schema": { "type": "object", "additionalProperties": false, "properties": { "title": { "type": "string" }, "date": { "type": "string" }, "time": { "type": "string" }, "location": { "type": "string" } }, "required": ["title", "date", "time", "location"] } } }, "truncation": "disabled", "store": false, "background": false, "service_tier": "free", "user": null, "previous_response_id": null } ] }, "ResponseStreamContentPart": { "title": "Response Stream Content Part", "description": "A content part within a streaming event. Discriminated by `type`: `output_text` for assistant message content (reuses ResponseTextContent), `reasoning_text` for model reasoning (OSS extension).", "oneOf": [ { "$ref": "#/components/schemas/ResponseTextContent" }, { "$ref": "#/components/schemas/ResponseReasoningContent" } ], "discriminator": { "propertyName": "type", "mapping": { "output_text": "#/components/schemas/ResponseTextContent", "reasoning_text": "#/components/schemas/ResponseReasoningContent" } } }, "ResponseCreatedEvent": { "title": "Response Created Event", "type": "object", "description": "Emitted as the first SSE event when a streaming response begins. The embedded response object has status `in_progress` and an empty `output` array. Clients can use this event to capture the response `id` for later correlation.", "properties": { "type": { "type": "string", "enum": ["response.created"] }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response. Starts at 0 for `response.created`." }, "response": { "$ref": "#/components/schemas/ResponseResponse" } }, "required": ["type", "sequence_number", "response"], "example": { "type": "response.created", "sequence_number": 0, "response": { "id": "resp_18cb0a9a457241f5b0383ebeee31b80d", "object": "response", "created_at": 1775853213, "status": "in_progress", "model": "gpt-oss-120b", "output": [], "usage": null, "error": null, "incomplete_details": null, "instructions": null, "metadata": {}, "parallel_tool_calls": true, "tool_choice": "auto", "tools": [], "temperature": 1, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0, "reasoning": { "effort": "medium", "summary": null }, "text": { "format": { "type": "text" } }, "truncation": "disabled", "store": false, "background": false, "service_tier": "free" } } }, "ResponseInProgressEvent": { "title": "Response In Progress Event", "type": "object", "description": "Emitted when the response transitions to the `in_progress` state, immediately after `response.created`. The embedded response object still has an empty `output` array; model generation has not yet produced any content.", "properties": { "type": { "type": "string", "enum": ["response.in_progress"] }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "response": { "$ref": "#/components/schemas/ResponseResponse" } }, "required": ["type", "sequence_number", "response"], "example": { "type": "response.in_progress", "sequence_number": 1, "response": { "id": "resp_18cb0a9a457241f5b0383ebeee31b80d", "object": "response", "created_at": 1775853213, "status": "in_progress", "model": "gpt-oss-120b", "output": [], "usage": null, "error": null, "incomplete_details": null, "instructions": null, "metadata": {}, "parallel_tool_calls": true, "tool_choice": "auto", "tools": [], "temperature": 1, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0, "reasoning": { "effort": "medium", "summary": null }, "text": { "format": { "type": "text" } }, "truncation": "disabled", "store": false, "background": false, "service_tier": "free" } } }, "ResponseOutputItemAddedEvent": { "title": "Response Output Item Added Event", "type": "object", "description": "Emitted when a new output item (message, function call, or reasoning) is added to the response output array. The item has `status: in_progress` and may have empty content at this point.", "properties": { "type": { "type": "string", "enum": ["response.output_item.added"] }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "output_index": { "type": "integer", "description": "Index of the output item in the response `output` array." }, "item": { "$ref": "#/components/schemas/ResponseOutputItem" } }, "required": ["type", "sequence_number", "output_index", "item"], "examples": [ { "type": "response.output_item.added", "sequence_number": 2, "output_index": 0, "item": { "id": "rs_d608e0328e6340a69919f808ee38df6c", "type": "reasoning", "status": "in_progress", "summary": [], "content": [] } }, { "type": "response.output_item.added", "sequence_number": 8, "output_index": 1, "item": { "id": "msg_c1eb06dccbc64f469533bb51be664a9e", "type": "message", "role": "assistant", "status": "in_progress", "content": [] } }, { "type": "response.output_item.added", "sequence_number": 8, "output_index": 1, "item": { "id": "fc_c839dacb61a54c10b6560ad8d161f004", "type": "function_call", "call_id": "call_e52f086a16c94fa796", "name": "get_weather", "arguments": "", "status": "in_progress" } } ] }, "ResponseContentPartAddedEvent": { "title": "Response Content Part Added Event", "type": "object", "description": "Emitted when a new content part is added to an output item's content array. The part's `text` is empty at this point; subsequent `response.output_text.delta` or `response.reasoning_text.delta` events carry the incremental content.", "properties": { "type": { "type": "string", "enum": ["response.content_part.added"] }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "item_id": { "type": "string", "description": "ID of the output item to which this content part belongs." }, "output_index": { "type": "integer", "description": "Index of the parent output item in the response `output` array." }, "content_index": { "type": "integer", "description": "Index of this content part within the output item's `content` array." }, "part": { "$ref": "#/components/schemas/ResponseStreamContentPart" } }, "required": [ "type", "sequence_number", "item_id", "output_index", "content_index", "part" ], "examples": [ { "type": "response.content_part.added", "sequence_number": 3, "item_id": "rs_d608e0328e6340a69919f808ee38df6c", "output_index": 0, "content_index": 0, "part": { "type": "reasoning_text", "text": "" } }, { "type": "response.content_part.added", "sequence_number": 9, "item_id": "msg_c1eb06dccbc64f469533bb51be664a9e", "output_index": 1, "content_index": 0, "part": { "type": "output_text", "text": "", "annotations": [], "logprobs": [] } } ] }, "ResponseReasoningTextDeltaEvent": { "title": "Response Reasoning Text Delta Event", "type": "object", "description": "Emitted for each incremental chunk of reasoning text generated by the model. Accumulate `delta` values in order to reconstruct the full reasoning text.", "properties": { "type": { "type": "string", "enum": ["response.reasoning_text.delta"] }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "item_id": { "type": "string", "description": "ID of the reasoning output item this delta belongs to." }, "output_index": { "type": "integer", "description": "Index of the reasoning output item in the response `output` array." }, "delta": { "type": "string", "description": "The incremental chunk of reasoning text." } }, "required": [ "type", "sequence_number", "item_id", "output_index", "delta" ], "example": { "type": "response.reasoning_text.delta", "sequence_number": 4, "item_id": "rs_d608e0328e6340a69919f808ee38df6c", "output_index": 0, "delta": "User wants a three-sentence bedtime story about a unicorn. Provide three sentences, gentle, bedtime. Should be concise." } }, "ResponseReasoningTextDoneEvent": { "title": "Response Reasoning Text Done Event", "type": "object", "description": "Emitted when a reasoning content part has been fully generated. The `text` field contains the complete accumulated reasoning text (equivalent to concatenating all preceding `response.reasoning_text.delta` values). Structural mirror of `response.reasoning_text.delta` with `text` instead of `delta`.", "properties": { "type": { "type": "string", "enum": ["response.reasoning_text.done"], "x-stainless-const": true }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "item_id": { "type": "string", "description": "ID of the reasoning output item this content belongs to." }, "output_index": { "type": "integer", "description": "Index of the reasoning output item in the response `output` array." }, "text": { "type": "string", "description": "The full accumulated reasoning text for this content part." } }, "required": [ "type", "sequence_number", "item_id", "output_index", "text" ], "example": { "type": "response.reasoning_text.done", "sequence_number": 5, "item_id": "rs_d608e0328e6340a69919f808ee38df6c", "output_index": 0, "text": "User wants a three-sentence bedtime story about a unicorn. Provide three sentences, gentle, bedtime. Should be concise." } }, "ResponseOutputTextDeltaEvent": { "title": "Response Output Text Delta Event", "type": "object", "description": "Emitted for each incremental chunk of assistant message text. Accumulate `delta` values in order to reconstruct the full output text.", "properties": { "type": { "type": "string", "enum": ["response.output_text.delta"] }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "item_id": { "type": "string", "description": "ID of the message output item this delta belongs to." }, "output_index": { "type": "integer", "description": "Index of the message output item in the response `output` array." }, "content_index": { "type": "integer", "description": "Index of the content part within the output item's `content` array." }, "delta": { "type": "string", "description": "The incremental chunk of output text." }, "annotations": { "type": "array", "items": { "$ref": "#/components/schemas/ResponseAnnotation" }, "description": "Annotations attached to this delta chunk, if any." }, "logprobs": { "type": "array", "items": { "$ref": "#/components/schemas/LogProbsContent" }, "description": "Log probability information for the tokens in this delta, if requested." } }, "required": [ "type", "sequence_number", "item_id", "output_index", "content_index", "delta", "annotations", "logprobs" ], "example": { "type": "response.output_text.delta", "sequence_number": 10, "item_id": "msg_c1eb06dccbc64f469533bb51be664a9e", "output_index": 1, "content_index": 0, "delta": "Under a moonlit canopy of twinkling stars, a silver-mane unicorn tiptoed into the meadow, leaving a trail of soft", "annotations": [], "logprobs": [] } }, "ResponseOutputTextDoneEvent": { "title": "Response Output Text Done Event", "type": "object", "description": "Emitted when an output text content part has been fully generated. The `text` field contains the complete accumulated output text (equivalent to concatenating all preceding `response.output_text.delta` values). Structural mirror of `response.output_text.delta` with `text` instead of `delta`.", "properties": { "type": { "type": "string", "enum": ["response.output_text.done"] }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "item_id": { "type": "string", "description": "ID of the message output item this content belongs to." }, "output_index": { "type": "integer", "description": "Index of the message output item in the response `output` array." }, "content_index": { "type": "integer", "description": "Index of the content part within the output item's `content` array." }, "text": { "type": "string", "description": "The full accumulated output text for this content part." }, "annotations": { "type": "array", "items": { "$ref": "#/components/schemas/ResponseAnnotation" }, "description": "All annotations attached to this text part." }, "logprobs": { "type": "array", "items": { "$ref": "#/components/schemas/LogProbsContent" }, "description": "Log probability information for all tokens, if requested." } }, "required": [ "type", "sequence_number", "item_id", "output_index", "content_index", "text", "annotations", "logprobs" ], "example": { "type": "response.output_text.done", "sequence_number": 15, "item_id": "msg_c1eb06dccbc64f469533bb51be664a9e", "output_index": 1, "content_index": 0, "annotations": [], "logprobs": [], "text": "Under a moonlit canopy of twinkling stars, a silver-mane unicorn tiptoed into the meadow, leaving a trail of soft, glowing stardust behind each gentle step. She whispered a lullaby to the sleepy flowers, and they swayed in rhythm, their petals folding like tiny blankets around the night. As the world hushed, the unicorn curled around a sleepy child's dream, gifting them a night of sweet, sparkling adventures until sunrise." } }, "ResponseContentPartDoneEvent": { "title": "Response Content Part Done Event", "type": "object", "description": "Emitted when a content part has been fully generated. The `part` field contains the complete content for this part (equivalent to the state after accumulating all preceding delta events). Structural mirror of `response.content_part.added`.", "properties": { "type": { "type": "string", "enum": ["response.content_part.done"] }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "item_id": { "type": "string", "description": "ID of the output item this content part belongs to." }, "output_index": { "type": "integer", "description": "Index of the parent output item in the response `output` array." }, "content_index": { "type": "integer", "description": "Index of this content part within the output item's `content` array." }, "part": { "$ref": "#/components/schemas/ResponseStreamContentPart" } }, "required": [ "type", "sequence_number", "item_id", "output_index", "content_index", "part" ], "examples": [ { "type": "response.content_part.done", "sequence_number": 6, "item_id": "rs_d608e0328e6340a69919f808ee38df6c", "output_index": 0, "content_index": 0, "part": { "type": "reasoning_text", "text": "User wants a three-sentence bedtime story about a unicorn. Provide three sentences, gentle, bedtime. Should be concise." } }, { "type": "response.content_part.done", "sequence_number": 16, "item_id": "msg_c1eb06dccbc64f469533bb51be664a9e", "output_index": 1, "content_index": 0, "part": { "type": "output_text", "annotations": [], "logprobs": [], "text": "Under a moonlit canopy of twinkling stars, a silver-mane unicorn tiptoed into the meadow, leaving a trail of soft, glowing stardust behind each gentle step. She whispered a lullaby to the sleepy flowers, and they swayed in rhythm, their petals folding like tiny blankets around the night. As the world hushed, the unicorn curled around a sleepy child's dream, gifting them a night of sweet, sparkling adventures until sunrise." } } ] }, "ResponseFunctionCallArgumentsDeltaEvent": { "title": "Response Function Call Arguments Delta Event", "type": "object", "description": "Emitted for each incremental chunk of function call arguments JSON generated by the model. Accumulate `delta` values in order to reconstruct the full arguments string. The accumulated result will be a valid JSON string once the corresponding `response.function_call_arguments.done` event is received.", "properties": { "type": { "type": "string", "enum": ["response.function_call_arguments.delta"] }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "item_id": { "type": "string", "description": "ID of the function call output item this delta belongs to." }, "output_index": { "type": "integer", "description": "Index of the function call output item in the response `output` array." }, "delta": { "type": "string", "description": "The incremental chunk of the function call arguments JSON string." } }, "required": [ "type", "sequence_number", "item_id", "output_index", "delta" ], "example": { "type": "response.function_call_arguments.delta", "sequence_number": 9, "item_id": "fc_c839dacb61a54c10b6560ad8d161f004", "output_index": 1, "delta": "{\"city\":\"Bogotá\"}" } }, "ResponseFunctionCallArgumentsDoneEvent": { "title": "Response Function Call Arguments Done Event", "type": "object", "description": "Emitted when a function call's arguments have been fully generated. The `arguments` field contains the complete JSON arguments string (equivalent to concatenating all preceding `response.function_call_arguments.delta` values). Structural mirror of `response.function_call_arguments.delta` with `arguments` instead of `delta`.", "properties": { "type": { "type": "string", "enum": ["response.function_call_arguments.done"] }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "item_id": { "type": "string", "description": "ID of the function call output item." }, "output_index": { "type": "integer", "description": "Index of the function call output item in the response `output` array." }, "arguments": { "type": "string", "description": "The complete JSON arguments string for the function call." } }, "required": [ "type", "sequence_number", "item_id", "output_index", "arguments" ], "example": { "type": "response.function_call_arguments.done", "sequence_number": 10, "item_id": "fc_c839dacb61a54c10b6560ad8d161f004", "output_index": 1, "arguments": "{\"city\":\"Bogotá\"}" } }, "ResponseOutputItemDoneEvent": { "title": "Response Output Item Done Event", "type": "object", "description": "Emitted when an output item has been fully generated and its status transitions to `completed`. The `item` field contains the complete output item including all accumulated content. Structural mirror of `response.output_item.added`.", "properties": { "type": { "type": "string", "enum": ["response.output_item.done"] }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "output_index": { "type": "integer", "description": "Index of the output item in the response `output` array." }, "item": { "$ref": "#/components/schemas/ResponseOutputItem" } }, "required": ["type", "sequence_number", "output_index", "item"], "examples": [ { "type": "response.output_item.done", "sequence_number": 7, "output_index": 0, "item": { "id": "rs_d608e0328e6340a69919f808ee38df6c", "type": "reasoning", "status": "completed", "summary": [], "content": [ { "type": "reasoning_text", "text": "User wants a three-sentence bedtime story about a unicorn. Provide three sentences, gentle, bedtime. Should be concise." } ] } }, { "type": "response.output_item.done", "sequence_number": 17, "output_index": 1, "item": { "id": "msg_c1eb06dccbc64f469533bb51be664a9e", "type": "message", "role": "assistant", "status": "completed", "content": [ { "type": "output_text", "annotations": [], "logprobs": [], "text": "Under a moonlit canopy of twinkling stars, a silver-mane unicorn tiptoed into the meadow, leaving a trail of soft, glowing stardust behind each gentle step. She whispered a lullaby to the sleepy flowers, and they swayed in rhythm, their petals folding like tiny blankets around the night. As the world hushed, the unicorn curled around a sleepy child's dream, gifting them a night of sweet, sparkling adventures until sunrise." } ] } }, { "type": "response.output_item.done", "sequence_number": 11, "output_index": 1, "item": { "id": "fc_c839dacb61a54c10b6560ad8d161f004", "type": "function_call", "call_id": "call_e52f086a16c94fa796", "name": "get_weather", "arguments": "{\"city\":\"Bogotá\"}", "status": "completed" } } ] }, "ResponseCompletedEvent": { "title": "Response Completed Event", "type": "object", "description": "Emitted as the final SSE event when a streaming response has been fully generated. The embedded response object has `status: completed`, a fully populated `output` array, and a populated `usage` object. Structural mirror of `response.created`.", "properties": { "type": { "type": "string", "enum": ["response.completed"], "x-stainless-const": true }, "sequence_number": { "type": "integer", "description": "Monotonically increasing counter for ordering events within a streaming response." }, "response": { "$ref": "#/components/schemas/ResponseResponse" } }, "required": ["type", "sequence_number", "response"], "examples": [ { "type": "response.completed", "sequence_number": 18, "response": { "id": "resp_18cb0a9a457241f5b0383ebeee31b80d", "object": "response", "created_at": 1775853213, "completed_at": 1775853214, "status": "completed", "model": "gpt-oss-120b", "output": [ { "id": "rs_d608e0328e6340a69919f808ee38df6c", "type": "reasoning", "status": "completed", "summary": [], "content": [ { "type": "reasoning_text", "text": "User wants a three-sentence bedtime story about a unicorn. Provide three sentences, gentle, bedtime. Should be concise." } ] }, { "id": "msg_c1eb06dccbc64f469533bb51be664a9e", "type": "message", "role": "assistant", "status": "completed", "content": [ { "type": "output_text", "annotations": [], "logprobs": [], "text": "Under a moonlit canopy of twinkling stars, a silver-mane unicorn tiptoed into the meadow, leaving a trail of soft, glowing stardust behind each gentle step." } ] } ], "usage": { "input_tokens": 78, "output_tokens": 126, "total_tokens": 204, "input_tokens_details": { "cached_tokens": 0 } }, "tool_choice": "auto", "tools": [], "temperature": 1, "top_p": 1, "reasoning": { "effort": "medium", "summary": null }, "text": { "format": { "type": "text" } } } }, { "type": "response.completed", "sequence_number": 12, "response": { "id": "resp_e8e3ad78db7546ce969f79b0828f3be3", "object": "response", "created_at": 1775856350, "completed_at": 1775856350, "status": "completed", "model": "gpt-oss-120b", "output": [ { "id": "rs_c512ec8087b247b0962b64b7595c92d2", "type": "reasoning", "status": "completed", "summary": [], "content": [ { "type": "reasoning_text", "text": "User asks: \"What is the weather in Bogotá?\" Need to fetch current weather using function get_weather." } ] }, { "id": "fc_c839dacb61a54c10b6560ad8d161f004", "type": "function_call", "call_id": "call_e52f086a16c94fa796", "name": "get_weather", "arguments": "{\"city\":\"Bogotá\"}", "status": "completed" } ], "usage": { "input_tokens": 128, "output_tokens": 59, "total_tokens": 187, "input_tokens_details": { "cached_tokens": 0 }, "output_tokens_details": { "reasoning_tokens": 43 } }, "tools": [ { "type": "function", "name": "get_weather", "description": "Get the current weather for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] }, "strict": null } ] } }, { "type": "response.completed", "sequence_number": 14, "response": { "id": "resp_673393d2de28449581eb6190a8168f84", "object": "response", "created_at": 1775517028, "completed_at": 1775517028, "status": "completed", "model": "gpt-oss-120b", "output": [ { "id": "rs_0c34dec41df941b2bce83e11a7614d31", "type": "reasoning", "status": "completed", "summary": [], "content": [ { "type": "reasoning_text", "text": "The user wants to extract event info from a sentence. We need to output a JSON in the prescribed format." } ] }, { "id": "msg_3b1e13019bd84ebcbcf0c15f45f91dfe", "type": "message", "role": "assistant", "status": "completed", "content": [ { "type": "output_text", "annotations": [], "logprobs": [], "text": "{\n \"title\": \"SambaNova demo\",\n \"date\": \"2026-04-18\",\n \"time\": \"15:30\",\n \"location\": \"San Francisco\"\n}\n" } ] } ], "usage": { "input_tokens": 131, "output_tokens": 280, "total_tokens": 411, "input_tokens_details": { "cached_tokens": 0 } }, "text": { "format": { "type": "json_schema", "name": "event_extraction", "schema": { "type": "object", "additionalProperties": false, "properties": { "title": { "type": "string" }, "date": { "type": "string" }, "time": { "type": "string" }, "location": { "type": "string" } }, "required": ["title", "date", "time", "location"] } } } } } ] }, "ResponseStreamEvent": { "title": "Response Stream Event", "description": "Top-level discriminated union of all Server-Sent Events emitted during a streaming `POST /responses` call. Discriminated by the `type` field. Events arrive in `sequence_number` order and cover the full lifecycle of a response: creation, content generation (text, reasoning, function call arguments), and completion.", "oneOf": [ { "$ref": "#/components/schemas/ResponseCreatedEvent" }, { "$ref": "#/components/schemas/ResponseInProgressEvent" }, { "$ref": "#/components/schemas/ResponseOutputItemAddedEvent" }, { "$ref": "#/components/schemas/ResponseContentPartAddedEvent" }, { "$ref": "#/components/schemas/ResponseReasoningTextDeltaEvent" }, { "$ref": "#/components/schemas/ResponseReasoningTextDoneEvent" }, { "$ref": "#/components/schemas/ResponseOutputTextDeltaEvent" }, { "$ref": "#/components/schemas/ResponseOutputTextDoneEvent" }, { "$ref": "#/components/schemas/ResponseFunctionCallArgumentsDeltaEvent" }, { "$ref": "#/components/schemas/ResponseFunctionCallArgumentsDoneEvent" }, { "$ref": "#/components/schemas/ResponseContentPartDoneEvent" }, { "$ref": "#/components/schemas/ResponseOutputItemDoneEvent" }, { "$ref": "#/components/schemas/ResponseCompletedEvent" } ], "discriminator": { "propertyName": "type", "mapping": { "response.created": "#/components/schemas/ResponseCreatedEvent", "response.in_progress": "#/components/schemas/ResponseInProgressEvent", "response.output_item.added": "#/components/schemas/ResponseOutputItemAddedEvent", "response.content_part.added": "#/components/schemas/ResponseContentPartAddedEvent", "response.reasoning_text.delta": "#/components/schemas/ResponseReasoningTextDeltaEvent", "response.reasoning_text.done": "#/components/schemas/ResponseReasoningTextDoneEvent", "response.output_text.delta": "#/components/schemas/ResponseOutputTextDeltaEvent", "response.output_text.done": "#/components/schemas/ResponseOutputTextDoneEvent", "response.function_call_arguments.delta": "#/components/schemas/ResponseFunctionCallArgumentsDeltaEvent", "response.function_call_arguments.done": "#/components/schemas/ResponseFunctionCallArgumentsDoneEvent", "response.content_part.done": "#/components/schemas/ResponseContentPartDoneEvent", "response.output_item.done": "#/components/schemas/ResponseOutputItemDoneEvent", "response.completed": "#/components/schemas/ResponseCompletedEvent" } } }, "ModelMetadata": { "title": "Model Metadata", "type": "object", "description": "model metadata", "additionalProperties": true, "properties": { "id": { "title": "Id", "type": "string", "description": "model id" }, "object": { "title": "Object", "type": "string", "description": "type", "const": "model", "default": "model", "enum": ["model"] }, "owned_by": { "title": "OwnedBy", "type": "string", "description": "model owner" }, "context_length": { "title": "context length", "type": "integer", "description": "model context length" }, "max_completion_tokens": { "title": "max completion tokens", "type": "integer", "description": "model max completion tokens" }, "sn_metadata": { "title": "sn metadata", "type": "object", "description": "additional sn metadata" }, "pricing": { "title": "pricing", "type": "object", "description": "pricing details", "additionalProperties": true, "properties": { "prompt": { "title": "prompt", "type": "number", "description": "price per prompt token in USD" }, "completion": { "title": "completion", "type": "number", "description": "price per completion token in USD" }, "duration_per_hour": { "title": "duration per hour", "type": "number", "description": "price per input hour", "nullable": true } } } }, "required": ["id"] }, "ModelMetadataList": { "title": "Model Metadata List", "type": "object", "description": "object containing available models and metadata", "additionalProperties": true, "properties": { "data": { "title": "Data", "type": "array", "description": "array of model metadata list", "items": { "$ref": "#/components/schemas/ModelMetadata" } }, "object": { "title": "Object", "type": "string", "const": "list", "default": "list", "enum": ["list"] } }, "required": ["data"] }, "EmbeddingsRequest": { "title": "Embeddings Request", "type": "object", "description": "embeddings request object", "additionalProperties": true, "properties": { "model": { "title": "Model", "description": "The model ID to use See available [models](https://docs.sambanova.ai/docs/en/models/sambacloud-models)", "anyOf": [ { "type": "string" }, { "enum": ["E5-Mistral-7B-Instruct"] } ] }, "input": { "title": "input", "description": "Input text to embed. to embed multiple inputs in a single request, pass an array of strings. The input must not exceed the max input tokens for the model", "oneOf": [ { "type": "string", "description": "The string that will be turned into an embedding." }, { "type": "array", "description": "The array of strings that will be turned into an embeddings.", "minItems": 1, "items": { "type": "string" } } ] }, "encoding_format": { "title": "Encoding Format", "description": "The format to return the embeddings in. Can be either `float` or `base64`. Omitted from the request when not set.", "type": "string", "enum": ["float", "base64"], "default": "float", "nullable": true } }, "required": ["model", "input"], "example": { "input": ["text to embed number 1", "text to embed number 2"], "model": "E5-Mistral-7B-Instruct" } }, "Embedding": { "type": "object", "title": "Embedding", "description": "Represents an embedding vector returned by embeddings endpoint.", "properties": { "index": { "type": "integer", "title": "index", "description": "The index of the embedding in the list of embeddings." }, "object": { "type": "string", "title": "object", "description": "Object type, always embedding.", "enum": ["embedding"] }, "embedding": { "type": "array", "items": { "type": "number" }, "title": "embedding", "description": "List of floats containing the embedding vector.", "nullable": true } }, "required": ["index", "object", "embedding"] }, "EmbeddingsResponse": { "title": "Embeddings Response", "type": "object", "description": "Embeddings response returned by the model", "properties": { "object": { "title": "object", "type": "string", "description": "The object type, which is always \"list\".", "enum": ["list"] }, "model": { "type": "string", "description": "The name of the model used to generate the embedding." }, "usage": { "$ref": "#/components/schemas/Usage" }, "data": { "type": "array", "description": "The list of embeddings generated by the model.", "items": { "$ref": "#/components/schemas/Embedding" } } }, "required": ["object", "model", "usage", "data"], "example": { "data": [ { "index": 0, "object": "embedding", "embedding": [ 0.024864232167601585, -0.01452154759317636, 0.008880083449184895 ] }, { "index": 1, "object": "embedding", "embedding": [ 0.010919672437012196, 0.0016351072117686272, 0.008019134402275085 ] } ], "model": "E5-Mistral-7B-Instruct", "object": "list", "usage": { "prompt_tokens": 716, "total_tokens": 716 } } }, "TranscriptionTranslationRequestProperties": { "title": "Transcription Translation Request Properties", "type": "object", "additionalProperties": true, "properties": { "model": { "title": "Model", "description": "The model ID to use See available [models](https://docs.sambanova.ai/docs/en/models/sambacloud-models)", "anyOf": [{ "type": "string" }, { "enum": ["Whisper-Large-v3"] }] }, "file": { "title": "file", "description": "The audio file object to transcribe or translate, in one of these formats: FLAC, MP3, MP4, MPEG, MPGA, M4A, Ogg, WAV, or WebM format. File size limit is 25MB.", "type": "string", "format": "binary" }, "prompt": { "title": "prompt", "description": "Optional text prompt provided to influence transcription Translation style or vocabulary. Example: “Please transcribe carefully, including pauses and hesitations.”", "type": "string", "nullable": true }, "language": { "title": "language", "description": "Optional language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency.", "nullable": true, "type": "string", "enum": [ "en", "zh", "de", "es", "ru", "ko", "fr", "ja", "pt", "tr", "pl", "ca", "nl", "ar", "sv", "it", "id", "hi", "fi", "vi", "he", "uk", "el", "ms", "cs", "ro", "da", "hu", "ta", "no", "th", "ur", "hr", "bg", "lt", "la", "mi", "ml", "cy", "sk", "te", "fa", "lv", "bn", "sr", "az", "sl", "kn", "et", "mk", "br", "eu", "is", "hy", "ne", "mn", "bs", "kk", "sq", "sw", "gl", "mr", "pa", "si", "km", "sn", "yo", "so", "af", "oc", "ka", "be", "tg", "sd", "gu", "am", "yi", "lo", "uz", "fo", "ht", "ps", "tk", "nn", "mt", "sa", "lb", "my", "bo", "tl", "mg", "as", "tt", "haw", "ln", "ha", "ba", "jw", "su", "yue" ] }, "response_format": { "title": "response format", "description": "Output format JSON or text.", "type": "string", "enum": ["json", "text"], "default": "json" }, "stream": { "title": "stream", "description": "Enables streaming responses.", "type": "string", "enum": ["true", "false"], "default": "false", "x-stainless-override-schema": { "type": "boolean", "default": false } }, "stream_options": { "title": "stream options", "description": "Optional settings that apply when `stream` is true.", "type": "object", "properties": { "include_usage": { "title": "include usage", "description": "If true and `stream` is enabled, optional usage metadata will be included in the last streamed response event.", "type": "string", "enum": ["true", "false"], "x-stainless-override-schema": { "type": "boolean" }, "nullable": true } }, "nullable": true } } }, "TranscriptionRequest": { "type": "object", "title": "Transcription Request", "description": "Transcription request object", "allOf": [ { "$ref": "#/components/schemas/TranscriptionTranslationRequestProperties" } ], "required": ["model", "file"], "example": { "model": "Whisper-Large-v3", "file": "(binary audio file, e.g. \"sample.wav\")", "prompt": "Please transcribe carefully, including pauses and hesitations.", "language": "es", "response_format": "json", "stream": true, "stream_options": { "include_usage": true } } }, "TranslationRequest": { "type": "object", "title": "Translation Request", "description": "Translation request object", "allOf": [ { "$ref": "#/components/schemas/TranscriptionTranslationRequestProperties" } ], "required": ["model", "file"], "example": { "model": "Whisper-Large-v3", "file": "(binary audio file, e.g. \"sample.wav\")", "prompt": "Please translate carefully, including pauses and hesitations.", "language": "es", "response_format": "json", "stream": true, "stream_options": { "include_usage": true } } }, "TranscriptionResponse": { "type": "object", "title": "Transcription Response", "description": "Transcription response json object", "additionalProperties": true, "properties": { "text": { "title": "text", "description": "audio file text transcription", "type": "string" } }, "required": ["text"], "example": { "text": "Es un efecto de sonido de una campana sonando, específicamente una campana de iglesia." } }, "TranslationResponse": { "type": "object", "title": "Translation Response", "description": "Translation response json object", "additionalProperties": true, "properties": { "text": { "title": "text", "description": "audio file english text translation", "type": "string" } }, "required": ["text"], "example": { "text": "It's a sound effect of a bell chiming, specifically a church bell." } }, "TranscriptionTranslationResponseDelta": { "title": "Transcription Response Delta", "type": "object", "description": "Transcription or translation response delta chunk generated by streamed model responses.", "additionalProperties": true, "properties": { "role": { "title": "Role", "type": "string", "description": "The role of the messages author", "enum": ["assistant"], "const": "assistant", "nullable": true }, "content": { "title": "Content", "type": "string", "description": "The content delta of the transcription or translation.", "nullable": true } }, "required": ["content"] }, "TranscriptionTranslationChunkChoice": { "title": "Transcription Translation Chunk Choice", "type": "object", "description": "Transcription or translation chunk choice generated by streamed model responses.", "additionalProperties": true, "properties": { "delta": { "$ref": "#/components/schemas/TranscriptionTranslationResponseDelta" }, "finish_reason": { "title": "Finish Reason", "type": "string", "description": "The reason the model stopped generating tokens", "enum": ["stop"], "nullable": true }, "index": { "title": "Index", "type": "integer", "description": "The index of the choice in the list of choices" }, "logprobs": { "title": "Logprobs", "anyOf": [{ "$ref": "#/components/schemas/LogProbs" }], "description": "currently not supported, always null will be returned", "nullable": true } }, "required": ["index", "delta"] }, "TranscriptionTranslationResponseProperties": { "title": "Transcription Translation Response Properties", "type": "object", "additionalProperties": true, "properties": { "choices": { "title": "Choices", "type": "array", "description": "A list of transcription or translation choices.", "items": { "$ref": "#/components/schemas/TranscriptionTranslationChunkChoice" }, "minItems": 0, "nullable": true }, "created": { "title": "Created", "type": "number", "description": "The Unix timestamp (in seconds) of when the chat completion was created." }, "id": { "title": "Id", "type": "string", "description": "A unique identifier for the chat completion." }, "model": { "title": "Model", "description": "The model used for the chat completion.", "type": "string" }, "object": { "title": "Object", "type": "string", "description": "The object type, always `chat.completion.chunk`.", "enum": ["chat.completion.chunk"], "const": "chat.completion.chunk" }, "system_fingerprint": { "title": "System fingerprint", "type": "string", "description": "Backend configuration that the model runs with." }, "usage": { "$ref": "#/components/schemas/Usage" } } }, "TranscriptionStreamResponse": { "type": "object", "title": "Transcription Stream Response", "description": "streamed chunk of a transcription response returned by the model", "allOf": [ { "$ref": "#/components/schemas/TranscriptionTranslationResponseProperties" } ], "required": [ "choices", "created", "id", "model", "object", "system_fingerprint" ], "examples": [ { "choices": [ { "delta": { "content": "es un sonido" }, "index": 0, "finish_reason": null, "logprobs": null } ], "created": 1737642515.3407679, "custom_id": 0, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "Whisper-Large-v3", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe" }, { "choices": [], "created": 1737642515.3407679, "custom_id": 0, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "Whisper-Large-v3", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe", "usage": { "completion_tokens": 100, "completion_tokens_after_first_per_sec": 262.2771255106759, "completion_tokens_after_first_per_sec_first_ten": 266.98193514986144, "completion_tokens_after_first_per_sec_graph": 53.16720674817285, "completion_tokens_per_sec": 217.87260449707574, "end_time": 1737642515.9077535, "is_last_response": true, "prompt_tokens": 43, "start_time": 1737642515.4458635, "time_to_first_token": 0.0844266414642334, "total_latency": 0.4589838186899821, "total_tokens": 143, "total_tokens_per_sec": 311.55782443081836 } } ] }, "TranslationStreamResponse": { "type": "object", "title": "Translation Stream Response", "description": "streamed chunk of a translation response returned by the model", "allOf": [ { "$ref": "#/components/schemas/TranscriptionTranslationResponseProperties" } ], "required": [ "choices", "created", "id", "model", "object", "system_fingerprint" ], "examples": [ { "choices": [ { "delta": { "content": "It's a sound" }, "index": 0, "finish_reason": null, "logprobs": null } ], "created": 1737642515.6076705, "custom_id": 0, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "Whisper-Large-v3", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe" }, { "choices": [], "created": 1737642515.6076705, "custom_id": 0, "id": "15fcaba4-1c4a-48fc-bc6e-05b55ddfb30b", "model": "Whisper-Large-v3", "object": "chat.completion.chunk", "system_fingerprint": "fastcoe", "usage": { "completion_tokens": 100, "completion_tokens_after_first_per_sec": 262.2771255106759, "completion_tokens_after_first_per_sec_first_ten": 266.98193514986144, "completion_tokens_after_first_per_sec_graph": 53.16720674817285, "completion_tokens_per_sec": 217.87260449707574, "end_time": 1737642515.9077535, "is_last_response": true, "prompt_tokens": 43, "start_time": 1737642515.4458635, "time_to_first_token": 0.0844266414642334, "total_latency": 0.4589838186899821, "total_tokens": 143, "total_tokens_per_sec": 311.55782443081836 } } ] }, "MessageCacheControl": { "title": "Message Cache Control", "type": "object", "description": "Marks the preceding content block (or system text block) as a prompt- cache breakpoint. Marker positions are collected by the adapter; their wiring into the router's longest-prefix matching **In v1**: position is recorded; the `ttl` value is ignored.", "properties": { "type": { "title": "Type", "type": "string", "enum": ["ephemeral"], "const": "ephemeral", "description": "Cache breakpoint type. Only `ephemeral` is supported by Anthropic." }, "ttl": { "title": "TTL", "type": "string", "description": "Optional time-to-live hint (e.g. `\"5m\"`, `\"1h\"`). **Currently ignored** in v1", "nullable": true } }, "required": ["type"] }, "MessageSystemTextBlock": { "title": "Message System Text Block", "type": "object", "description": "A text segment within a structured `system` prompt array. Multiple text blocks are concatenated (with newlines) and prepended to the conversation as a `role: system` message at the chat-completions layer.", "properties": { "type": { "title": "Type", "type": "string", "enum": ["text"], "const": "text" }, "text": { "title": "Text", "type": "string", "description": "Plain-text content of the system prompt segment." }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" }, "citations": { "title": "Citations", "type": "array", "description": "Optional citations. **In v1**: silently dropped", "items": { "type": "object", "additionalProperties": true }, "nullable": true } }, "required": ["type", "text"] }, "MessageSystemPrompt": { "title": "Message System Prompt", "description": "System prompt for the conversation. Accepts either a single string (most common) or an array of text blocks (used when individual segments need `cache_control` markers). Multiple text blocks are joined with newlines and prepended to the conversation as a `role: system` message.", "anyOf": [ { "type": "string" }, { "title": "System Text Block Array", "type": "array", "items": { "$ref": "#/components/schemas/MessageSystemTextBlock" } } ] }, "MessageMetadata": { "title": "Message Metadata", "type": "object", "description": "Free-form metadata attached to the request. Currently only `user_id` Additional fields are accepted but ignored.", "properties": { "user_id": { "title": "User Id", "type": "string", "description": "External identifier for the end-user making the request. Mapped internally to the Chat Completions `user` field.", "nullable": true } }, "additionalProperties": true }, "MessageThinkingDisabled": { "title": "Message Thinking Disabled", "type": "object", "description": "Disables Anthropic-style extended thinking. **In v1**: silently accepted as a no-op", "properties": { "type": { "title": "Type", "type": "string", "enum": ["disabled"], "const": "disabled" } }, "required": ["type"] }, "MessageThinkingEnabled": { "title": "Message Thinking Enabled", "type": "object", "description": "Enables Anthropic-style extended thinking with a fixed budget. **In v1**: returns a 400 `invalid_request_error` (`unsupported_parameter`).", "properties": { "type": { "title": "Type", "type": "string", "enum": ["enabled"], "const": "enabled" }, "budget_tokens": { "title": "Budget Tokens", "type": "integer", "minimum": 1024, "description": "Maximum tokens the model may spend on extended thinking before producing the final answer." } }, "required": ["type", "budget_tokens"] }, "MessageThinkingAdaptive": { "title": "Message Thinking Adaptive", "type": "object", "description": "Enables Anthropic-style adaptive extended thinking. **In v1**: returns a 400 `invalid_request_error` (`unsupported_parameter`).", "properties": { "type": { "title": "Type", "type": "string", "enum": ["adaptive"], "const": "adaptive" }, "budget_tokens": { "title": "Budget Tokens", "type": "integer", "minimum": 1024, "nullable": true, "description": "Optional upper bound on tokens spent on adaptive thinking. When omitted, the backend chooses based on prompt complexity." } }, "required": ["type"] }, "MessageThinkingConfig": { "title": "Message Thinking Config", "description": "Controls Anthropic-style extended thinking. **In v1**: only `type:\"disabled\"` is silently accepted as a no-op; `type:\"enabled\"` and `type:\"adaptive\"` return a 400 `invalid_request_error` (`unsupported_parameter`).", "oneOf": [ { "$ref": "#/components/schemas/MessageThinkingDisabled" }, { "$ref": "#/components/schemas/MessageThinkingEnabled" }, { "$ref": "#/components/schemas/MessageThinkingAdaptive" } ], "discriminator": { "propertyName": "type", "mapping": { "disabled": "#/components/schemas/MessageThinkingDisabled", "enabled": "#/components/schemas/MessageThinkingEnabled", "adaptive": "#/components/schemas/MessageThinkingAdaptive" } } }, "MessageInputImageSourceBase64": { "title": "Message Input Image Source (Base64)", "type": "object", "description": "Inline image data encoded as base64.", "properties": { "type": { "type": "string", "enum": ["base64"], "const": "base64" }, "media_type": { "type": "string", "enum": ["image/jpeg", "image/png", "image/webp"], "description": "MIME type of the image bytes." }, "data": { "type": "string", "description": "Base64-encoded image bytes (no `data:` URI prefix)." } }, "required": ["type", "media_type", "data"] }, "MessageInputImageSourceUrl": { "title": "Message Input Image Source (URL)", "type": "object", "description": "HTTPS URL pointing to an image. **Returns 400 in v1** — URL fetching is blocked. Use `type:\"base64\"` instead.", "properties": { "type": { "type": "string", "enum": ["url"], "const": "url" }, "url": { "type": "string", "format": "uri" } }, "required": ["type", "url"] }, "MessageInputVideoSourceBase64": { "title": "Message Input Video Source (Base64)", "type": "object", "description": "Inline video data encoded as base64.", "properties": { "type": { "type": "string", "enum": ["base64"], "const": "base64" }, "media_type": { "type": "string", "enum": ["video/mp4"], "description": "MIME type of the video bytes." }, "data": { "type": "string", "description": "Base64-encoded video bytes (no `data:` URI prefix)." } }, "required": ["type", "media_type", "data"] }, "MessageInputVideoSourceUrl": { "title": "Message Input Video Source (URL)", "type": "object", "description": "HTTPS URL pointing to a video.", "properties": { "type": { "type": "string", "enum": ["url"], "const": "url" }, "url": { "type": "string", "format": "uri" } }, "required": ["type", "url"] }, "MessageInputTextBlock": { "title": "Message Input Text Block", "type": "object", "description": "Plain-text segment of a message.", "properties": { "type": { "type": "string", "enum": ["text"], "const": "text" }, "text": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" }, "citations": { "title": "Citations", "type": "array", "items": { "type": "object", "additionalProperties": true }, "nullable": true } }, "required": ["type", "text"] }, "MessageInputImageBlock": { "title": "Message Input Image Block", "type": "object", "description": "Image content. Only `source.type:\"base64\"` is supported in v1; URL sources return 400.", "properties": { "type": { "type": "string", "enum": ["image"], "const": "image" }, "source": { "oneOf": [ { "$ref": "#/components/schemas/MessageInputImageSourceBase64" }, { "$ref": "#/components/schemas/MessageInputImageSourceUrl" } ], "discriminator": { "propertyName": "type", "mapping": { "base64": "#/components/schemas/MessageInputImageSourceBase64", "url": "#/components/schemas/MessageInputImageSourceUrl" } } }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "source"] }, "MessageInputVideoBlock": { "title": "Message Input Video Block", "type": "object", "description": "Video content.", "properties": { "type": { "type": "string", "enum": ["video"], "const": "video" }, "source": { "oneOf": [ { "$ref": "#/components/schemas/MessageInputVideoSourceBase64" }, { "$ref": "#/components/schemas/MessageInputVideoSourceUrl" } ], "discriminator": { "propertyName": "type", "mapping": { "base64": "#/components/schemas/MessageInputVideoSourceBase64", "url": "#/components/schemas/MessageInputVideoSourceUrl" } } }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "source"] }, "MessageInputToolUseBlock": { "title": "Message Input Tool Use Block", "type": "object", "description": "A prior assistant turn that invoked a tool.", "properties": { "type": { "type": "string", "enum": ["tool_use"], "const": "tool_use" }, "id": { "type": "string", "description": "Unique identifier for the tool call (used to correlate `tool_result`)." }, "name": { "type": "string", "description": "Name of the tool being invoked." }, "input": { "type": "object", "additionalProperties": true, "description": "Tool inputs as a JSON object." }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "id", "name", "input"] }, "MessageInputServerToolUseBlock": { "title": "Message Input Server Tool Use Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side tools. A prior assistant turn that invoked an Anthropic-hosted tool (web_search, code_execution, etc.). Accepted in conversation history (e.g. replaying an Anthropic-served session) but never originates from a SambaNova response. New `server_tool_use`-type tool definitions on outgoing requests are rejected with 400 `unsupported_tool_type`.", "properties": { "type": { "type": "string", "enum": ["server_tool_use"], "const": "server_tool_use" }, "id": { "type": "string" }, "name": { "type": "string" }, "input": { "type": "object", "additionalProperties": true }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "id", "name", "input"] }, "MessageInputSearchResultBlock": { "title": "Message Input Search Result Block", "type": "object", "description": "Inline search result content. In v1 the `title`, `source`, and `content[]` text are extracted into a text block; citations are dropped.", "properties": { "type": { "type": "string", "enum": ["search_result"], "const": "search_result" }, "title": { "type": "string" }, "source": { "type": "string" }, "content": { "type": "array", "items": { "$ref": "#/components/schemas/MessageInputTextBlock" } }, "citations": { "type": "object", "additionalProperties": true, "nullable": true }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type"] }, "MessageInputThinkingBlock": { "title": "Message Input Thinking Block", "type": "object", "description": "Extended-reasoning trace from a prior assistant turn.", "properties": { "type": { "type": "string", "enum": ["thinking"], "const": "thinking" }, "thinking": { "type": "string" }, "signature": { "type": "string" } }, "required": ["type", "thinking", "signature"] }, "MessageInputRedactedThinkingBlock": { "title": "Message Input Redacted Thinking Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not produce encrypted thinking output. Echo of a prior Anthropic-served response where `thinking.display:\"omitted\"` was set. Accepted in conversation history but never originates from a SambaNova response. Silently dropped on input.", "properties": { "type": { "type": "string", "enum": ["redacted_thinking"], "const": "redacted_thinking" }, "data": { "type": "string" } }, "required": ["type", "data"] }, "MessageInputContainerUploadBlock": { "title": "Message Input Container Upload Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not produce container_upload blocks (these come from Anthropic's server-side `code_execution` tool). Accepted in conversation history but never originates from a SambaNova response. Silently dropped on input.", "properties": { "type": { "type": "string", "enum": ["container_upload"], "const": "container_upload" }, "file_id": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "file_id"] }, "MessageInputDocumentBlock": { "title": "Message Input Document Block", "type": "object", "description": "PDF or document content. **Returns 400** — no document-extraction pipeline available.", "properties": { "type": { "type": "string", "enum": ["document"], "const": "document" }, "source": { "type": "object", "additionalProperties": true }, "title": { "type": "string", "nullable": true }, "context": { "type": "string", "nullable": true }, "citations": { "type": "object", "additionalProperties": true, "nullable": true }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "source"] }, "MessageInputToolResultContent": { "title": "Message Input Tool Result Content", "description": "Content of a `tool_result` block. only text is forwarded.", "oneOf": [ { "$ref": "#/components/schemas/MessageInputTextBlock" }, { "$ref": "#/components/schemas/MessageInputImageBlock" } ], "discriminator": { "propertyName": "type", "mapping": { "text": "#/components/schemas/MessageInputTextBlock", "image": "#/components/schemas/MessageInputImageBlock" } } }, "MessageInputToolResultBlock": { "title": "Message Input Tool Result Block", "type": "object", "description": "Result of a prior tool call.", "properties": { "type": { "type": "string", "enum": ["tool_result"], "const": "tool_result" }, "tool_use_id": { "type": "string", "description": "ID of the `tool_use` block this result corresponds to." }, "content": { "anyOf": [ { "type": "string" }, { "title": "Tool Result Content Array", "type": "array", "items": { "$ref": "#/components/schemas/MessageInputToolResultContent" } } ] }, "is_error": { "type": "boolean", "nullable": true, "description": "Silently dropped in v1." }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "tool_use_id"] }, "MessageInputWebSearchToolResultBlock": { "title": "Message Input Web Search Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side `web_search`. Echo of a prior Anthropic-served `web_search` tool call; accepted in conversation history but never originates from a SambaNova response. When present, only `title` (`url`) per result is extracted into a tool message.", "properties": { "type": { "type": "string", "enum": ["web_search_tool_result"], "const": "web_search_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "tool_use_id", "content"] }, "MessageInputWebFetchToolResultBlock": { "title": "Message Input Web Fetch Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side `web_fetch`. Echo of a prior Anthropic-served `web_fetch` tool call; accepted in conversation history but never originates from a SambaNova response. When present, only the text content is extracted.", "properties": { "type": { "type": "string", "enum": ["web_fetch_tool_result"], "const": "web_fetch_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "object", "additionalProperties": true }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "tool_use_id", "content"] }, "MessageInputCodeExecutionToolResultBlock": { "title": "Message Input Code Execution Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side `code_execution`. Echo of a prior Anthropic-served `code_execution` tool call; accepted in conversation history but never originates from a SambaNova response. When present, only `stdout`, `stderr`, and `return_code` are extracted; image output is dropped.", "properties": { "type": { "type": "string", "enum": ["code_execution_tool_result"], "const": "code_execution_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "object", "additionalProperties": true }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "tool_use_id", "content"] }, "MessageInputBashCodeExecutionToolResultBlock": { "title": "Message Input Bash Code Execution Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side bash code execution. Echo of a prior Anthropic-served bash tool call; accepted in conversation history but never originates from a SambaNova response. Same lossy extraction as `code_execution_tool_result`.", "properties": { "type": { "type": "string", "enum": ["bash_code_execution_tool_result"], "const": "bash_code_execution_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "object", "additionalProperties": true }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "tool_use_id", "content"] }, "MessageInputTextEditorCodeExecutionToolResultBlock": { "title": "Message Input Text Editor Code Execution Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side text-editor code execution. Echo of a prior Anthropic-served text-editor tool call; accepted in conversation history but never originates from a SambaNova response. When present, only file content is extracted; metadata (line count, file type) is dropped.", "properties": { "type": { "type": "string", "enum": ["text_editor_code_execution_tool_result"], "const": "text_editor_code_execution_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "object", "additionalProperties": true }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "tool_use_id", "content"] }, "MessageInputToolSearchToolResultBlock": { "title": "Message Input Tool Search Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side `tool_search`. Echo of a prior Anthropic-served `tool_search` tool call; accepted in conversation history but never originates from a SambaNova response. When present, an empty string is emitted to the tool message (no plain-text fields).", "properties": { "type": { "type": "string", "enum": ["tool_search_tool_result"], "const": "tool_search_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "object", "additionalProperties": true }, "cache_control": { "$ref": "#/components/schemas/MessageCacheControl" } }, "required": ["type", "tool_use_id", "content"] }, "MessageInputContentBlock": { "title": "Message Input Content Block", "description": "Typed content block inside a message's `content` array.", "oneOf": [ { "$ref": "#/components/schemas/MessageInputTextBlock" }, { "$ref": "#/components/schemas/MessageInputImageBlock" }, { "$ref": "#/components/schemas/MessageInputVideoBlock" }, { "$ref": "#/components/schemas/MessageInputToolUseBlock" }, { "$ref": "#/components/schemas/MessageInputToolResultBlock" }, { "$ref": "#/components/schemas/MessageInputServerToolUseBlock" }, { "$ref": "#/components/schemas/MessageInputSearchResultBlock" }, { "$ref": "#/components/schemas/MessageInputWebSearchToolResultBlock" }, { "$ref": "#/components/schemas/MessageInputWebFetchToolResultBlock" }, { "$ref": "#/components/schemas/MessageInputCodeExecutionToolResultBlock" }, { "$ref": "#/components/schemas/MessageInputBashCodeExecutionToolResultBlock" }, { "$ref": "#/components/schemas/MessageInputTextEditorCodeExecutionToolResultBlock" }, { "$ref": "#/components/schemas/MessageInputToolSearchToolResultBlock" }, { "$ref": "#/components/schemas/MessageInputThinkingBlock" }, { "$ref": "#/components/schemas/MessageInputRedactedThinkingBlock" }, { "$ref": "#/components/schemas/MessageInputContainerUploadBlock" }, { "$ref": "#/components/schemas/MessageInputDocumentBlock" } ], "discriminator": { "propertyName": "type", "mapping": { "text": "#/components/schemas/MessageInputTextBlock", "image": "#/components/schemas/MessageInputImageBlock", "video": "#/components/schemas/MessageInputVideoBlock", "tool_use": "#/components/schemas/MessageInputToolUseBlock", "tool_result": "#/components/schemas/MessageInputToolResultBlock", "server_tool_use": "#/components/schemas/MessageInputServerToolUseBlock", "search_result": "#/components/schemas/MessageInputSearchResultBlock", "web_search_tool_result": "#/components/schemas/MessageInputWebSearchToolResultBlock", "web_fetch_tool_result": "#/components/schemas/MessageInputWebFetchToolResultBlock", "code_execution_tool_result": "#/components/schemas/MessageInputCodeExecutionToolResultBlock", "bash_code_execution_tool_result": "#/components/schemas/MessageInputBashCodeExecutionToolResultBlock", "text_editor_code_execution_tool_result": "#/components/schemas/MessageInputTextEditorCodeExecutionToolResultBlock", "tool_search_tool_result": "#/components/schemas/MessageInputToolSearchToolResultBlock", "thinking": "#/components/schemas/MessageInputThinkingBlock", "redacted_thinking": "#/components/schemas/MessageInputRedactedThinkingBlock", "container_upload": "#/components/schemas/MessageInputContainerUploadBlock", "document": "#/components/schemas/MessageInputDocumentBlock" } } }, "MessageInputMessage": { "title": "Message Input Message", "type": "object", "description": "A turn in the conversation.", "properties": { "role": { "type": "string", "enum": ["user", "assistant"], "description": "Conversational role. `user` for the human-side turn, `assistant` for prior model output." }, "content": { "anyOf": [ { "type": "string" }, { "title": "Content Block Array", "type": "array", "items": { "$ref": "#/components/schemas/MessageInputContentBlock" } } ] } }, "required": ["role", "content"] }, "MessageTool": { "title": "Message Tool", "type": "object", "description": "User-defined function tool definition. Only custom function tools are supported (Anthropic's `type:\"custom\"` style or the absent-type Beta style). Anthropic-hosted server tools (`web_search`, `code_execution`, `bash`, `text_editor`, `memory`, `tool_search` variants) return 400 `unsupported_tool_type` if sent.", "properties": { "name": { "type": "string", "description": "Tool name. Must match `^[a-zA-Z0-9_-]+$`." }, "type": { "type": "string", "enum": ["custom"], "nullable": true, "description": "Tool-type discriminator. May be omitted (defaults to custom) or set to `custom`. Other values return 400 `unsupported_tool_type`." }, "description": { "type": "string", "nullable": true, "description": "Human-readable description of when the tool should be used." }, "input_schema": { "type": "object", "additionalProperties": true, "nullable": true, "description": "JSON Schema describing the tool's expected input. Required by the Anthropic spec; accepted as optional by SambaNova." }, "cache_control": { "allOf": [{ "$ref": "#/components/schemas/MessageCacheControl" }], "nullable": true, "description": "Silently dropped on tool definitions (only content and system cache markers participate in caching)." }, "input_examples": { "type": "array", "items": { "type": "object", "additionalProperties": true }, "nullable": true, "description": "Silently dropped." }, "allowed_callers": { "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Silently dropped." }, "defer_loading": { "type": "boolean", "nullable": true, "description": "Silently dropped." }, "eager_input_streaming": { "type": "boolean", "nullable": true, "description": "Silently dropped." }, "strict": { "type": "boolean", "nullable": true, "description": "Silently dropped." } }, "required": ["name"] }, "MessageToolChoiceAuto": { "title": "Message Tool Choice (Auto)", "type": "object", "description": "Let the model decide whether and which tool to use.", "properties": { "type": { "type": "string", "enum": ["auto"], "const": "auto" }, "disable_parallel_tool_use": { "type": "boolean", "nullable": true, "description": "Silently dropped." } }, "required": ["type"] }, "MessageToolChoiceAny": { "title": "Message Tool Choice (Any)", "type": "object", "description": "Require the model to call one of the provided tools.", "properties": { "type": { "type": "string", "enum": ["any"], "const": "any" }, "disable_parallel_tool_use": { "type": "boolean", "nullable": true, "description": "Silently dropped." } }, "required": ["type"] }, "MessageToolChoiceNone": { "title": "Message Tool Choice (None)", "type": "object", "description": "Forbid the model from calling any tool.", "properties": { "type": { "type": "string", "enum": ["none"], "const": "none" } }, "required": ["type"] }, "MessageToolChoiceTool": { "title": "Message Tool Choice (Tool)", "type": "object", "description": "Force the model to call a specific tool by name.", "properties": { "type": { "type": "string", "enum": ["tool"], "const": "tool" }, "name": { "type": "string", "description": "Name of the required tool." }, "disable_parallel_tool_use": { "type": "boolean", "nullable": true, "description": "Silently dropped." } }, "required": ["type", "name"] }, "MessageToolChoice": { "title": "Message Tool Choice", "description": "How the model should choose from the provided tools.", "oneOf": [ { "$ref": "#/components/schemas/MessageToolChoiceAuto" }, { "$ref": "#/components/schemas/MessageToolChoiceAny" }, { "$ref": "#/components/schemas/MessageToolChoiceNone" }, { "$ref": "#/components/schemas/MessageToolChoiceTool" } ], "discriminator": { "propertyName": "type", "mapping": { "auto": "#/components/schemas/MessageToolChoiceAuto", "any": "#/components/schemas/MessageToolChoiceAny", "none": "#/components/schemas/MessageToolChoiceNone", "tool": "#/components/schemas/MessageToolChoiceTool" } } }, "MessageCreateRequest": { "title": "Message Create Request", "type": "object", "description": "Request body for `POST /messages`. Wire-compatible with the official Anthropic Messages API. Required fields: `model`, `max_tokens`, `messages`.", "additionalProperties": true, "properties": { "model": { "title": "Model", "description": "The model ID to use (e.g. gpt-oss-120b). See available [models](https://docs.sambanova.ai/docs/en/models/sambacloud-models)", "anyOf": [ { "type": "string" }, { "enum": [ "Meta-Llama-3.3-70B-Instruct", "Meta-Llama-3.2-1B-Instruct", "Meta-Llama-3.2-3B-Instruct", "Llama-3.2-11B-Vision-Instruct", "Llama-3.2-90B-Vision-Instruct", "Meta-Llama-3.1-8B-Instruct", "Meta-Llama-3.1-70B-Instruct", "Meta-Llama-3.1-405B-Instruct", "Qwen2.5-Coder-32B-Instruct", "Qwen2.5-72B-Instruct", "QwQ-32B-Preview", "Meta-Llama-Guard-3-8B", "DeepSeek-R1", "DeepSeek-R1-0528", "DeepSeek-V3-0324", "DeepSeek-V3.1", "DeepSeek-V3.1-cb", "DeepSeek-V3.1-Terminus", "DeepSeek-V3.2", "DeepSeek-R1-Distill-Llama-70B", "Llama-4-Maverick-17B-128E-Instruct", "Llama-4-Scout-17B-16E-Instruct", "Qwen3-32B", "Qwen3-235B", "Llama-3.3-Swallow-70B-Instruct-v0.4", "gpt-oss-120b", "ALLaM-7B-Instruct-preview", "MiniMax-M2.5", "MiniMax-M2.7", "gemma-3-12b-it" ] } ], "example": "gpt-oss-120b" }, "max_tokens": { "title": "Max Tokens", "type": "integer", "minimum": 1, "description": "Maximum number of tokens to generate. The combined input + output token count is bounded by the model's context window.", "example": 1024 }, "messages": { "title": "Messages", "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/MessageInputMessage" }, "description": "Conversation turns." }, "system": { "$ref": "#/components/schemas/MessageSystemPrompt" }, "temperature": { "title": "Temperature", "type": "number", "minimum": 0, "maximum": 2, "nullable": true, "description": "Sampling temperature in `[0.0, 2.0]`. Higher values produce more random output, lower values more deterministic. Adjust only one of `temperature`, `top_p`, `top_k`.", "example": 1 }, "top_p": { "title": "Top P", "type": "number", "minimum": 0, "maximum": 1, "nullable": true, "description": "Nucleus sampling. Considers tokens with cumulative probability mass up to `top_p`." }, "top_k": { "title": "Top K", "type": "integer", "minimum": 0, "nullable": true, "description": "Top-k sampling. Considers only the K most likely tokens at each step. Set to 0 to disable." }, "stop_sequences": { "title": "Stop Sequences", "type": "array", "items": { "type": "string" }, "nullable": true, "description": "Custom strings that, when generated, cause the model to stop." }, "stream": { "title": "Stream", "type": "boolean", "default": false, "nullable": true, "description": "If true, the response is a sequence of Server-Sent Events whose payloads conform to `MessageStreamEvent`." }, "metadata": { "$ref": "#/components/schemas/MessageMetadata" }, "thinking": { "$ref": "#/components/schemas/MessageThinkingConfig" }, "tools": { "title": "Tools", "type": "array", "items": { "$ref": "#/components/schemas/MessageTool" }, "nullable": true, "description": "Tool definitions the model may call." }, "tool_choice": { "allOf": [{ "$ref": "#/components/schemas/MessageToolChoice" }], "nullable": true, "description": "Controls how the model selects from `tools`." }, "service_tier": { "title": "Service Tier", "type": "string", "enum": ["auto", "standard_only"], "nullable": true, "description": "Service-tier preference. **In v1**: silently dropped" }, "container": { "title": "Container", "type": "string", "nullable": true, "description": "Existing code-execution container ID to reuse. **In v1**: silently dropped" } }, "required": ["model", "max_tokens", "messages"], "example": { "model": "DeepSeek-V3.1", "max_tokens": 1024, "messages": [{ "role": "user", "content": "Hello, Claude!" }] } }, "MessageOutputTextBlock": { "title": "Message Output Text Block", "type": "object", "description": "Plain-text segment of the model's response.", "properties": { "type": { "type": "string", "enum": ["text"], "const": "text" }, "text": { "type": "string" }, "citations": { "type": "array", "items": { "type": "object", "additionalProperties": true }, "nullable": true, "description": "Not emitted in v1." } }, "required": ["type", "text"] }, "MessageOutputToolUseBlock": { "title": "Message Output Tool Use Block", "type": "object", "description": "Tool call generated by the model.", "properties": { "type": { "type": "string", "enum": ["tool_use"], "const": "tool_use" }, "id": { "type": "string", "description": "Unique identifier for this tool call." }, "name": { "type": "string", "description": "Name of the tool being called." }, "input": { "type": "object", "additionalProperties": true, "description": "Tool inputs as a JSON object." }, "caller": { "type": "object", "additionalProperties": true, "nullable": true, "description": "Anthropic routing metadata. Always `null` in SambaNova responses." } }, "required": ["type", "id", "name", "input"] }, "MessageOutputThinkingBlock": { "title": "Message Output Thinking Block", "type": "object", "description": "Extended-reasoning trace from the model. Emitted by reasoning models.", "properties": { "type": { "type": "string", "enum": ["thinking"], "const": "thinking" }, "thinking": { "type": "string" }, "signature": { "type": "string", "nullable": true } }, "required": ["type", "thinking"] }, "MessageOutputRedactedThinkingBlock": { "title": "Message Output Redacted Thinking Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not produce encrypted thinking output. Never emitted in responses.", "properties": { "type": { "type": "string", "enum": ["redacted_thinking"], "const": "redacted_thinking" }, "data": { "type": "string" } }, "required": ["type", "data"] }, "MessageOutputServerToolUseBlock": { "title": "Message Output Server Tool Use Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side tools. Never emitted in responses; defined for Anthropic SDK type-parity.", "properties": { "type": { "type": "string", "enum": ["server_tool_use"], "const": "server_tool_use" }, "id": { "type": "string" }, "name": { "type": "string" }, "input": { "type": "object", "additionalProperties": true } }, "required": ["type", "id", "name", "input"] }, "MessageOutputWebSearchToolResultBlock": { "title": "Message Output Web Search Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side `web_search`. Never emitted in responses.", "properties": { "type": { "type": "string", "enum": ["web_search_tool_result"], "const": "web_search_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "array", "items": { "type": "object", "additionalProperties": true } } }, "required": ["type", "tool_use_id", "content"] }, "MessageOutputWebFetchToolResultBlock": { "title": "Message Output Web Fetch Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side `web_fetch`. Never emitted in responses.", "properties": { "type": { "type": "string", "enum": ["web_fetch_tool_result"], "const": "web_fetch_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "object", "additionalProperties": true } }, "required": ["type", "tool_use_id", "content"] }, "MessageOutputCodeExecutionToolResultBlock": { "title": "Message Output Code Execution Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side `code_execution`. Never emitted in responses.", "properties": { "type": { "type": "string", "enum": ["code_execution_tool_result"], "const": "code_execution_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "object", "additionalProperties": true } }, "required": ["type", "tool_use_id", "content"] }, "MessageOutputBashCodeExecutionToolResultBlock": { "title": "Message Output Bash Code Execution Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side bash code execution. Never emitted in responses.", "properties": { "type": { "type": "string", "enum": ["bash_code_execution_tool_result"], "const": "bash_code_execution_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "object", "additionalProperties": true } }, "required": ["type", "tool_use_id", "content"] }, "MessageOutputTextEditorCodeExecutionToolResultBlock": { "title": "Message Output Text Editor Code Execution Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side text-editor code execution. Never emitted in responses.", "properties": { "type": { "type": "string", "enum": ["text_editor_code_execution_tool_result"], "const": "text_editor_code_execution_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "object", "additionalProperties": true } }, "required": ["type", "tool_use_id", "content"] }, "MessageOutputToolSearchToolResultBlock": { "title": "Message Output Tool Search Tool Result Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not run server-side `tool_search`. Never emitted in responses.", "properties": { "type": { "type": "string", "enum": ["tool_search_tool_result"], "const": "tool_search_tool_result" }, "tool_use_id": { "type": "string" }, "content": { "type": "object", "additionalProperties": true } }, "required": ["type", "tool_use_id", "content"] }, "MessageOutputContainerUploadBlock": { "title": "Message Output Container Upload Block", "type": "object", "description": "Anthropic compatibility only — SambaNova does not produce container_upload blocks (these come from Anthropic's server-side `code_execution` tool). Never emitted in responses.", "properties": { "type": { "type": "string", "enum": ["container_upload"], "const": "container_upload" }, "file_id": { "type": "string" } }, "required": ["type", "file_id"] }, "MessageOutputContentBlock": { "title": "Message Output Content Block", "description": "Typed content block in the model's response.", "oneOf": [ { "$ref": "#/components/schemas/MessageOutputTextBlock" }, { "$ref": "#/components/schemas/MessageOutputToolUseBlock" }, { "$ref": "#/components/schemas/MessageOutputThinkingBlock" }, { "$ref": "#/components/schemas/MessageOutputRedactedThinkingBlock" }, { "$ref": "#/components/schemas/MessageOutputServerToolUseBlock" }, { "$ref": "#/components/schemas/MessageOutputWebSearchToolResultBlock" }, { "$ref": "#/components/schemas/MessageOutputWebFetchToolResultBlock" }, { "$ref": "#/components/schemas/MessageOutputCodeExecutionToolResultBlock" }, { "$ref": "#/components/schemas/MessageOutputBashCodeExecutionToolResultBlock" }, { "$ref": "#/components/schemas/MessageOutputTextEditorCodeExecutionToolResultBlock" }, { "$ref": "#/components/schemas/MessageOutputToolSearchToolResultBlock" }, { "$ref": "#/components/schemas/MessageOutputContainerUploadBlock" } ], "discriminator": { "propertyName": "type", "mapping": { "text": "#/components/schemas/MessageOutputTextBlock", "tool_use": "#/components/schemas/MessageOutputToolUseBlock", "thinking": "#/components/schemas/MessageOutputThinkingBlock", "redacted_thinking": "#/components/schemas/MessageOutputRedactedThinkingBlock", "server_tool_use": "#/components/schemas/MessageOutputServerToolUseBlock", "web_search_tool_result": "#/components/schemas/MessageOutputWebSearchToolResultBlock", "web_fetch_tool_result": "#/components/schemas/MessageOutputWebFetchToolResultBlock", "code_execution_tool_result": "#/components/schemas/MessageOutputCodeExecutionToolResultBlock", "bash_code_execution_tool_result": "#/components/schemas/MessageOutputBashCodeExecutionToolResultBlock", "text_editor_code_execution_tool_result": "#/components/schemas/MessageOutputTextEditorCodeExecutionToolResultBlock", "tool_search_tool_result": "#/components/schemas/MessageOutputToolSearchToolResultBlock", "container_upload": "#/components/schemas/MessageOutputContainerUploadBlock" } } }, "MessageStopReason": { "title": "Message Stop Reason", "type": "string", "description": "Reason the model stopped generating. SambaNova emits `end_turn`, `max_tokens`, `tool_use`, and `stop_sequence`. The remaining values are defined for Anthropic SDK type-parity but never returned: `pause_turn` (server-tool loop limit, not produced); `refusal` (content filter, not exposed); `model_context_window_exceeded` (folded to `max_tokens`).", "enum": [ "end_turn", "max_tokens", "tool_use", "pause_turn", "refusal", "stop_sequence", "model_context_window_exceeded" ] }, "MessageUsage": { "title": "Message Usage", "type": "object", "description": "Token accounting for the request.", "properties": { "input_tokens": { "type": "integer", "description": "Total tokens in the prompt (system + messages + tools)." }, "output_tokens": { "type": "integer", "description": "Total tokens generated by the model." }, "cache_creation_input_tokens": { "type": "integer", "nullable": true, "description": "Tokens written to prompt cache. Absent in v1; emitted once prompt caching wiring lands (CP-2897)." }, "cache_read_input_tokens": { "type": "integer", "nullable": true, "description": "Tokens read from prompt cache. Absent in v1; emitted once prompt caching wiring lands (CP-2897)." }, "server_tool_use": { "type": "object", "additionalProperties": true, "nullable": true, "description": "Server-tool usage metrics (e.g. `web_search_requests`). Anthropic compatibility only — SambaNova does not run server tools, so this field is never emitted." }, "service_tier": { "type": "string", "nullable": true, "description": "Service tier that processed the request. Anthropic compatibility only — SambaNova is single-tier and never emits this field." }, "cache_creation": { "type": "object", "additionalProperties": true, "nullable": true, "description": "Anthropic SDK alias for cache write metrics. Always `null` in SambaNova responses; use `cache_creation_input_tokens` instead." }, "inference_geo": { "type": "string", "nullable": true, "description": "Geographic region that served the request. Anthropic compatibility only - SambaNova does not expose geo routing, always `null`." } }, "required": ["input_tokens", "output_tokens"] }, "MessageContainer": { "title": "Message Container", "type": "object", "description": "Code-execution container reference. Anthropic compatibility only — SambaNova does not run server-side code execution, so this field is never emitted on responses.", "properties": { "id": { "type": "string" }, "expires_at": { "type": "string", "description": "ISO-8601 timestamp." } }, "required": ["id", "expires_at"] }, "MessageStopDetails": { "title": "Message Stop Details", "type": "object", "description": "Refusal stop details. Anthropic compatibility only — `refusal` is never emitted as a stop_reason by SambaNova (content filtering is not exposed at the API layer).", "properties": { "type": { "type": "string", "enum": ["refusal"], "const": "refusal" }, "category": { "type": "string", "enum": ["cyber", "bio"] } }, "required": ["type"] }, "Message": { "title": "Message", "type": "object", "description": "Non-streaming response from `POST /messages`. Wire-compatible with the official Anthropic Messages API.", "properties": { "id": { "type": "string", "description": "Unique identifier for this message." }, "type": { "type": "string", "enum": ["message"], "const": "message" }, "role": { "type": "string", "enum": ["assistant"], "const": "assistant" }, "content": { "type": "array", "items": { "$ref": "#/components/schemas/MessageOutputContentBlock" } }, "model": { "type": "string", "description": "Model that produced the response." }, "stop_reason": { "allOf": [{ "$ref": "#/components/schemas/MessageStopReason" }], "nullable": true }, "stop_sequence": { "type": "string", "nullable": true, "description": "The matched stop sequence that triggered termination. Present when `stop_reason` is `stop_sequence`; `null` otherwise." }, "stop_details": { "allOf": [{ "$ref": "#/components/schemas/MessageStopDetails" }], "nullable": true }, "usage": { "$ref": "#/components/schemas/MessageUsage" }, "container": { "allOf": [{ "$ref": "#/components/schemas/MessageContainer" }], "nullable": true } }, "required": [ "id", "type", "role", "content", "model", "stop_reason", "usage" ] }, "MessageContentBlockTextDelta": { "title": "Content Block Text Delta", "type": "object", "description": "Incremental text chunk for an open text content block.", "properties": { "type": { "type": "string", "enum": ["text_delta"], "const": "text_delta" }, "text": { "type": "string" } }, "required": ["type", "text"] }, "MessageContentBlockInputJsonDelta": { "title": "Content Block Input JSON Delta", "type": "object", "description": "Incremental fragment of a tool_use block's `input` JSON. Concatenate successive `partial_json` strings to reconstruct the full input object.", "properties": { "type": { "type": "string", "enum": ["input_json_delta"], "const": "input_json_delta" }, "partial_json": { "type": "string" } }, "required": ["type", "partial_json"] }, "MessageContentBlockThinkingDelta": { "title": "Content Block Thinking Delta", "type": "object", "description": "Incremental thinking chunk for an open thinking block. Emitted by reasoning models.", "properties": { "type": { "type": "string", "enum": ["thinking_delta"], "const": "thinking_delta" }, "thinking": { "type": "string" } }, "required": ["type", "thinking"] }, "MessageContentBlockSignatureDelta": { "title": "Content Block Signature Delta", "type": "object", "description": "Signature for an open thinking block. Emitted at the end of a thinking stream (paired with the closing `content_block_stop`); the `signature` value may be an empty string when the backend has no signed payload to attach.", "properties": { "type": { "type": "string", "enum": ["signature_delta"], "const": "signature_delta" }, "signature": { "type": "string" } }, "required": ["type", "signature"] }, "MessageContentBlockDelta": { "title": "Content Block Delta", "description": "Incremental update to an open content block.", "oneOf": [ { "$ref": "#/components/schemas/MessageContentBlockTextDelta" }, { "$ref": "#/components/schemas/MessageContentBlockInputJsonDelta" }, { "$ref": "#/components/schemas/MessageContentBlockThinkingDelta" }, { "$ref": "#/components/schemas/MessageContentBlockSignatureDelta" } ], "discriminator": { "propertyName": "type", "mapping": { "text_delta": "#/components/schemas/MessageContentBlockTextDelta", "input_json_delta": "#/components/schemas/MessageContentBlockInputJsonDelta", "thinking_delta": "#/components/schemas/MessageContentBlockThinkingDelta", "signature_delta": "#/components/schemas/MessageContentBlockSignatureDelta" } } }, "MessageDeltaUsage": { "title": "Message Delta Usage", "type": "object", "description": "Final token accounting emitted in the closing `message_delta` event of a stream.", "properties": { "output_tokens": { "type": "integer", "description": "Total tokens generated (final count)." }, "input_tokens": { "type": "integer", "nullable": true, "description": "Total tokens in the prompt (echoed from `message_start`)." }, "cache_creation_input_tokens": { "type": "integer", "nullable": true, "description": "Tokens written to prompt cache. Absent in v1;" }, "cache_read_input_tokens": { "type": "integer", "nullable": true, "description": "Tokens read from prompt cache. Absent in v1;" }, "server_tool_use": { "type": "object", "additionalProperties": true, "nullable": true, "description": "Server-tool usage metrics. Anthropic compatibility only — SambaNova does not run server tools, so this field is never emitted." } }, "required": ["output_tokens"] }, "MessageStartEvent": { "title": "Message Start Event", "type": "object", "description": "First event of a stream. Carries the initial Message envelope (empty `content[]`, `stop_reason: null`) and token usage from prompt processing.", "properties": { "type": { "type": "string", "enum": ["message_start"], "const": "message_start" }, "message": { "$ref": "#/components/schemas/Message" } }, "required": ["type", "message"] }, "MessageContentBlockStartEvent": { "title": "Content Block Start Event", "type": "object", "description": "Opens a new content block. One per block in `content[]`.", "properties": { "type": { "type": "string", "enum": ["content_block_start"], "const": "content_block_start" }, "index": { "type": "integer", "description": "Zero-based index of the block within `content[]`." }, "content_block": { "$ref": "#/components/schemas/MessageOutputContentBlock" } }, "required": ["type", "index", "content_block"] }, "MessageContentBlockDeltaEvent": { "title": "Content Block Delta Event", "type": "object", "description": "Incremental update to the currently open content block.", "properties": { "type": { "type": "string", "enum": ["content_block_delta"], "const": "content_block_delta" }, "index": { "type": "integer", "description": "Zero-based index of the block within `content[]`." }, "delta": { "$ref": "#/components/schemas/MessageContentBlockDelta" } }, "required": ["type", "index", "delta"] }, "MessageContentBlockStopEvent": { "title": "Content Block Stop Event", "type": "object", "description": "Closes the current content block.", "properties": { "type": { "type": "string", "enum": ["content_block_stop"], "const": "content_block_stop" }, "index": { "type": "integer", "description": "Zero-based index of the block within `content[]`." } }, "required": ["type", "index"] }, "MessageDeltaEvent": { "title": "Message Delta Event", "type": "object", "description": "Penultimate event of the stream. Carries the final `stop_reason`, optional `stop_sequence`, and final usage counts.", "properties": { "type": { "type": "string", "enum": ["message_delta"], "const": "message_delta" }, "delta": { "type": "object", "properties": { "stop_reason": { "$ref": "#/components/schemas/MessageStopReason" }, "stop_sequence": { "type": "string", "nullable": true, "description": "Custom stop sequence that triggered termination. Field is emitted but value is always `null` in v1 (backend collapses `StopSequenceHit` and `EndOfText` into the same finish_reason)." }, "stop_details": { "allOf": [ { "$ref": "#/components/schemas/MessageStopDetails" } ], "nullable": true, "description": "Refusal stop details. Field is emitted but value is always `null` in v1 — `refusal` is not produced as a stop_reason." } }, "required": ["stop_reason"] }, "usage": { "$ref": "#/components/schemas/MessageDeltaUsage" } }, "required": ["type", "delta", "usage"] }, "MessageStopEvent": { "title": "Message Stop Event", "type": "object", "description": "Final event of the stream. No fields beyond `type`.", "properties": { "type": { "type": "string", "enum": ["message_stop"], "const": "message_stop" } }, "required": ["type"] }, "MessagePingEvent": { "title": "Message Ping Event", "type": "object", "description": "Keepalive heartbeat. May appear at any point in the stream.", "properties": { "type": { "type": "string", "enum": ["ping"], "const": "ping" } }, "required": ["type"] }, "MessageStreamErrorEvent": { "title": "Message Stream Error Event", "type": "object", "description": "Streamed error envelope. Terminates the stream.", "properties": { "type": { "type": "string", "enum": ["error"], "const": "error" }, "error": { "$ref": "#/components/schemas/MessageError" } }, "required": ["type", "error"] }, "MessageStreamEvent": { "title": "Message Stream Event", "description": "Discriminated union of SSE events emitted during a streaming `POST /messages` call. Event order: `message_start` -> (`content_block_start` -> `content_block_delta`×N -> `content_block_stop`) × blocks -> `message_delta` -> `message_stop`. A `ping` may appear at any point; an `error` event terminates the stream.", "oneOf": [ { "$ref": "#/components/schemas/MessageStartEvent" }, { "$ref": "#/components/schemas/MessageContentBlockStartEvent" }, { "$ref": "#/components/schemas/MessageContentBlockDeltaEvent" }, { "$ref": "#/components/schemas/MessageContentBlockStopEvent" }, { "$ref": "#/components/schemas/MessageDeltaEvent" }, { "$ref": "#/components/schemas/MessageStopEvent" }, { "$ref": "#/components/schemas/MessagePingEvent" }, { "$ref": "#/components/schemas/MessageStreamErrorEvent" } ], "discriminator": { "propertyName": "type", "mapping": { "message_start": "#/components/schemas/MessageStartEvent", "content_block_start": "#/components/schemas/MessageContentBlockStartEvent", "content_block_delta": "#/components/schemas/MessageContentBlockDeltaEvent", "content_block_stop": "#/components/schemas/MessageContentBlockStopEvent", "message_delta": "#/components/schemas/MessageDeltaEvent", "message_stop": "#/components/schemas/MessageStopEvent", "ping": "#/components/schemas/MessagePingEvent", "error": "#/components/schemas/MessageStreamErrorEvent" } } }, "MessageCountTokensRequest": { "title": "Message Count Tokens Request", "type": "object", "description": "Request body for `POST /messages/count_tokens`. Returns the input token count for a prompt without generating output. Same prompt shape as `MessageCreateRequest` minus generation-time parameters (`max_tokens`, `stream`, sampling, `stop_sequences`, `metadata`, `service_tier`, etc.).", "additionalProperties": true, "properties": { "model": { "title": "Model", "type": "string", "description": "Model identifier.", "example": "gpt-oss-120b" }, "messages": { "title": "Messages", "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/MessageInputMessage" }, "description": "Conversation turns." }, "system": { "$ref": "#/components/schemas/MessageSystemPrompt" }, "thinking": { "$ref": "#/components/schemas/MessageThinkingConfig" }, "tools": { "title": "Tools", "type": "array", "items": { "$ref": "#/components/schemas/MessageTool" }, "nullable": true, "description": "Tool definitions the model may call." }, "tool_choice": { "allOf": [{ "$ref": "#/components/schemas/MessageToolChoice" }], "nullable": true, "description": "Controls how the model selects from `tools`." } }, "required": ["model", "messages"], "example": { "model": "DeepSeek-V3.1", "messages": [{ "role": "user", "content": "Hello, Claude!" }] } }, "MessageCountTokensResponse": { "title": "Message Count Tokens Response", "type": "object", "description": "Token count for the supplied prompt.", "properties": { "input_tokens": { "type": "integer", "description": "Total tokens in the prompt (system + messages + tools)." } }, "required": ["input_tokens"] } } }, "paths": { "/chat/completions": { "post": { "operationId": "createChatCompletion", "tags": ["Chat completions"], "summary": "Create chat-based completion", "security": [{ "api_key": [] }], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatCompletionRequest" } } }, "description": "Chat prompt and parameters", "required": true }, "responses": { "200": { "description": "Successful Response, Returns a ChatCompletionResponse object (non-streaming), or a stream of server-sent ChatCompletionStreamResponse object events ending with a response.completed event (when stream: true).", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/ChatCompletionResponse" }, { "$ref": "#/components/schemas/ChatCompletionStreamResponse" } ] } } } }, "400": { "description": "Bad Request - Missing or invalid parameters", "content": { "text/plain": { "schema": { "type": "string", "example": "Invalid request body: - missing property 'model'\"" } }, "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/GeneralError" }, { "$ref": "#/components/schemas/SimpleError" } ] }, "examples": { "empty_messages": { "summary": "Empty messages array", "value": { "error": { "message": "Invalid 'messages': empty array. Expected an array with minimum length 1, but got an empty array instead.", "type": "invalid_request_error", "param": "messages", "code": "empty_array" }, "request_id": "d79vdot7os633dverihg" } }, "invalid_role": { "summary": "Invalid message role value", "value": { "error": { "message": "Invalid value: 'developerrr'. Supported values are: 'system', 'assistant', 'user', 'function', 'tool', and 'developer'.", "type": "invalid_request_error", "param": "messages[0].role", "code": "invalid_value" }, "request_id": "d79vdit7os6aemenqav0" } }, "null_content": { "summary": "Null user message content", "value": { "error": { "message": "Invalid value for 'content': expected a string, got null.", "type": "invalid_request_error", "param": "messages.[5].content", "code": null }, "request_id": "d79vcsd7os6aemenqa80" } }, "missing_model": { "summary": "No model parameter provided", "value": { "error": { "message": "you must provide a model parameter", "type": "invalid_request_error", "param": null, "code": null }, "request_id": "a4fa849e" } }, "invalid_json": { "summary": "Malformed JSON body", "value": { "error": { "code": null, "message": "We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. A JSON payload is expected, but what was sent was not valid JSON.)", "param": null, "type": "invalid_request_error" }, "request_id": "3f7db127" } }, "simple": { "summary": "Simple error (unhandled cases)", "value": { "error": "Unhandled error" } } } } } }, "401": { "description": "Unauthorized access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" }, "examples": { "invalid_api_key": { "summary": "Invalid API key provided", "value": { "error": { "message": "Incorrect API key provided: *****. You can find your API key at https://cloud.sambanova.ai/apis.", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" }, "request_id": "d79vcq57os633dverhi0" } }, "missing_api_key": { "summary": "No API key provided", "value": { "error": { "message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY).", "type": "invalid_request_error", "param": null, "code": null }, "request_id": "d7a0dct7os633dvesi60" } } } } } }, "404": { "description": "Not found - model does not exist or wrong endpoint called", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/GeneralError" }, { "$ref": "#/components/schemas/SimpleError" } ] }, "examples": { "model_not_found": { "summary": "Model does not exist or is not accessible", "value": { "error": { "code": "model_not_found", "message": "The model `abc` does not exist or you do not have access to it.", "param": "model", "type": "invalid_request_error" }, "request_id": "887a8227" } }, "simple": { "summary": "Simple error (unhandled cases e.g. wrong endpoint)", "value": { "error": "Not found" } } } } } }, "408": { "description": "Request timeout", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "410": { "description": "Gone - model is no longer available (deprecated or removed)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" } } } }, "500": { "description": "Internal Server Error. Unexpected issue on server side.", "content": { "text/plain": { "schema": { "type": "string" } } } }, "503": { "description": "Service Temporarily Unavailable", "content": { "text/plain": { "schema": { "type": "string", "example": "Service Temporarily Unavailable" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import SambaNova from 'sambanova';\n\nconst client = new SambaNova({\n apiKey: process.env['SAMBANOVA_API_KEY'], // This is the default and can be omitted\n});\n\nconst completion = await client.chat.completions.create({\n messages: [{ content: 'create a poem using palindromes', role: 'user' }],\n model: 'gpt-oss-120b',\n});\n\nconsole.log(completion);" }, { "lang": "Python", "source": "import os\nfrom sambanova import SambaNova\n\nclient = SambaNova(\n api_key=os.environ.get(\"SAMBANOVA_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.chat.completions.create(\n messages=[{\n \"content\": \"create a poem using palindromes\",\n \"role\": \"user\",\n }],\n model=\"gpt-oss-120b\",\n):\n print(completion)" } ] } }, "/completions": { "post": { "operationId": "createCompletion", "tags": ["Completions"], "summary": "Create completion", "security": [{ "api_key": [] }], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompletionRequest" } } }, "description": "text prompt and parameters", "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/CompletionResponse" }, { "$ref": "#/components/schemas/CompletionStreamResponse" } ] } } } }, "400": { "description": "Bad Request - Missing or invalid parameters", "content": { "text/plain": { "schema": { "type": "string", "example": "Invalid request body: - missing property 'model'\"" } }, "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/GeneralError" }, { "$ref": "#/components/schemas/SimpleError" } ] }, "examples": { "missing_model": { "summary": "No model parameter provided", "value": { "error": { "message": "you must provide a model parameter", "type": "invalid_request_error", "param": null, "code": null }, "request_id": "a4fa849e" } }, "invalid_json": { "summary": "Malformed JSON body", "value": { "error": { "code": null, "message": "We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. A JSON payload is expected, but what was sent was not valid JSON.)", "param": null, "type": "invalid_request_error" }, "request_id": "3f7db127" } }, "simple": { "summary": "Simple error (unhandled cases)", "value": { "error": "Model name is required" } } } } } }, "401": { "description": "Unauthorized access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" }, "examples": { "invalid_api_key": { "summary": "Invalid API key provided", "value": { "error": { "message": "Incorrect API key provided: *****. You can find your API key at https://cloud.sambanova.ai/apis.", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" }, "request_id": "d79vcq57os633dverhi0" } }, "missing_api_key": { "summary": "No API key provided", "value": { "error": { "message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY).", "type": "invalid_request_error", "param": null, "code": null }, "request_id": "d7a0dct7os633dvesi60" } } } } } }, "404": { "description": "Not found - model does not exist or wrong endpoint called", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/GeneralError" }, { "$ref": "#/components/schemas/SimpleError" } ] }, "examples": { "model_not_found": { "summary": "Model does not exist or is not accessible", "value": { "error": { "code": "model_not_found", "message": "The model `abc` does not exist or you do not have access to it.", "param": "model", "type": "invalid_request_error" }, "request_id": "887a8227" } }, "simple": { "summary": "Simple error (unhandled cases e.g. wrong endpoint)", "value": { "error": "Not found" } } } } } }, "408": { "description": "Request timeout", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "410": { "description": "Gone - model is no longer available (deprecated or removed)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" } } } }, "500": { "description": "Internal Server Error. Unexpected issue on server side.", "content": { "text/plain": { "schema": { "type": "string" } } } }, "503": { "description": "Service Temporarily Unavailable", "content": { "text/plain": { "schema": { "type": "string", "example": "Service Temporarily Unavailable" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import SambaNova from 'sambanova';\n\nconst client = new SambaNova({\n apiKey: process.env['SAMBANOVA_API_KEY'], // This is the default and can be omitted\n});\n\nconst completion = await client.completions.create({\n model: 'gpt-oss-120b',\n prompt:\n '<|begin_of_text|><|start_header_id|>system<|end_header_id|> You are a helpful assistant.<|eot_id|><|start_header_id|>user<|end_header_id|> create a poem using palindromes<|eot_id|><|start_header_id|>assistant<|end_header_id|>',\n});\n\nconsole.log(completion);" }, { "lang": "Python", "source": "import os\nfrom sambanova import SambaNova\n\nclient = SambaNova(\n api_key=os.environ.get(\"SAMBANOVA_API_KEY\"), # This is the default and can be omitted\n)\nfor completion in client.completions.create(\n model=\"gpt-oss-120b\",\n prompt=\"<|begin_of_text|><|start_header_id|>system<|end_header_id|> You are a helpful assistant.<|eot_id|><|start_header_id|>user<|end_header_id|> create a poem using palindromes<|eot_id|><|start_header_id|>assistant<|end_header_id|>\",\n):\n print(completion)" } ] } }, "/responses": { "post": { "operationId": "createResponse", "tags": ["Responses"], "summary": "Create a model response", "description": "Creates a model response for the given input. Only `type: \"function\"` tools are supported; other tool types are filtered server-side. SambaNova is stateless, conversation history must be supplied in full via `input[]` on each request.", "security": [{ "api_key": [] }], "requestBody": { "required": true, "description": "Response creation parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponseRequest" } } } }, "responses": { "200": { "description": "Successful response. Returns a ResponseResponse object (non-streaming), or a stream of server-sent ResponseStreamEvent object events ending with a response.completed event (when stream: true).", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/ResponseResponse" }, { "$ref": "#/components/schemas/ResponseStreamEvent" } ] } } } }, "400": { "description": "Bad Request — missing or invalid parameters", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/GeneralError" }, { "$ref": "#/components/schemas/SimpleError" } ] }, "examples": { "missing_input": { "summary": "Required field missing", "value": { "error": { "message": "Missing required field: 'input'.", "type": "invalid_request_error", "param": "input", "code": "missing_required_field" }, "request_id": "abc123" } }, "invalid_role": { "summary": "Invalid role on input item", "value": { "error": { "message": "Invalid value: 'foo'. Supported values are: 'user', 'assistant', 'system', 'developer'.", "type": "invalid_request_error", "param": "input[1].role", "code": "invalid_value" }, "request_id": "abc124" } }, "empty_input": { "summary": "Empty input array", "value": { "error": { "message": "Invalid value for 'input': expected a non-empty array or string.", "type": "invalid_request_error", "param": "input", "code": "invalid_value" }, "request_id": "abc125" } }, "invalid_json": { "summary": "Malformed JSON body", "value": { "error": { "code": null, "message": "We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. A JSON payload is expected, but what was sent was not valid JSON.)", "param": null, "type": "invalid_request_error" }, "request_id": "3f7db127" } }, "adapter_mapping_failed": { "summary": "Server failed to parse model tool call output", "value": { "error": { "code": "adapter_mapping_failed", "error_model_output": "{\n \"name\": \"get_weather\",\n \"arguments\": {\n city: \"Bogotá\"\n }\n}", "message": "Failed to parse tool call from GPT OSS output: Expecting property name enclosed in double quotes: line 4 column 5 (char 48)", "param": null, "type": "server_error" }, "request_id": "494e734dc82b4b37bd914238c79c3e6c" } }, "simple": { "summary": "Simple error (unhandled cases)", "value": { "error": "Unhandled error" } } } } } }, "401": { "description": "Unauthorized — invalid or missing API key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" }, "examples": { "invalid_api_key": { "summary": "Invalid API key", "value": { "error": { "message": "Incorrect API key provided: *****. You can find your API key at https://cloud.sambanova.ai/apis.", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" }, "request_id": "abc126" } }, "missing_api_key": { "summary": "No API key provided", "value": { "error": { "message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY).", "type": "invalid_request_error", "param": null, "code": null }, "request_id": "abc127" } } } } } }, "404": { "description": "Not found — model does not exist or is not accessible", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" }, "examples": { "model_not_found": { "summary": "Model does not exist or is not accessible", "value": { "error": { "message": "The model `abc` does not exist or you do not have access to it.", "type": "invalid_request_error", "param": "model", "code": "model_not_found" }, "request_id": "abc128" } }, "simple": { "summary": "Simple error (unhandled cases e.g. wrong endpoint)", "value": { "error": "Not found" } } } } } }, "408": { "description": "Request Timeout", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "410": { "description": "Gone — model is no longer available (deprecated or removed)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "429": { "description": "Too Many Requests — rate limit exceeded", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" } } } }, "500": { "description": "Internal Server Error — unexpected issue on server side", "content": { "text/plain": { "schema": { "type": "string" } } } }, "503": { "description": "Service Temporarily Unavailable", "content": { "text/plain": { "schema": { "type": "string", "example": "Service Temporarily Unavailable" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import SambaNova from 'sambanova';\n\nconst client = new SambaNova({\n apiKey: process.env['SAMBANOVA_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.responses.create({\n input: [\n {\n content: 'What is the weather in San Francisco?',\n role: 'user',\n type: 'message',\n },\n {\n content: [\n { text: 'The weather in San Francisco is 65°F and partly cloudy.', type: 'output_text' },\n ],\n role: 'assistant',\n type: 'message',\n },\n {\n content: 'What should I wear?',\n role: 'user',\n type: 'message',\n },\n ],\n model: 'gpt-oss-120b',\n});\n\nconsole.log(response);" }, { "lang": "Python", "source": "import os\nfrom sambanova import SambaNova\n\nclient = SambaNova(\n api_key=os.environ.get(\"SAMBANOVA_API_KEY\"), # This is the default and can be omitted\n)\nfor response in client.responses.create(\n input=[{\n \"content\": \"What is the weather in San Francisco?\",\n \"role\": \"user\",\n \"type\": \"message\",\n }, {\n \"content\": [{\n \"text\": \"The weather in San Francisco is 65°F and partly cloudy.\",\n \"type\": \"output_text\",\n }],\n \"role\": \"assistant\",\n \"type\": \"message\",\n }, {\n \"content\": \"What should I wear?\",\n \"role\": \"user\",\n \"type\": \"message\",\n }],\n model=\"gpt-oss-120b\",\n):\n print(response)" } ] } }, "/messages": { "post": { "operationId": "createMessage", "tags": ["Messages"], "summary": "Create a message", "description": "Anthropic Messages API compatible endpoint. Generates a model response for the supplied conversation. Authentication accepts either the bearer `Authorization: Bearer ` header (SambaNova SDK default) or the `x-api-key` header (Anthropic SDK default); the same API key is used in both cases. When `stream: true` is set, the response is a sequence of Server-Sent Events whose payloads conform to `MessageStreamEvent`; otherwise the response is a single `Message` object.", "security": [{ "api_key": [] }, { "x_api_key": [] }], "parameters": [ { "in": "header", "name": "anthropic-version", "required": false, "description": "Anthropic API version header sent by the official `anthropic` SDK. Accepted (any value) but currently has no effect on response shape — included for drop-in SDK compatibility.", "schema": { "title": "Anthropic Version", "type": "string", "example": "2023-06-01" } } ], "requestBody": { "required": true, "description": "Message creation parameters.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageCreateRequest" } } } }, "responses": { "200": { "description": "Successful response. Returns a `Message` object (non-streaming), or a stream of Server-Sent Events whose payloads conform to `MessageStreamEvent` ending with a `message_stop` event (when `stream: true`).", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Message" }, { "$ref": "#/components/schemas/MessageStreamEvent" } ] } } } }, "400": { "description": "Bad Request — `invalid_request_error`. Returned for missing or invalid parameters, unsupported feature flags (e.g. `thinking` with `type:\"enabled\"` or `\"adaptive\"`), unsupported tool types (`web_search`, `code_execution`, `bash`, `text_editor`, `memory`, `tool_search` variants), image source `type:\"url\"`, `document` content blocks, or non-object request bodies.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "401": { "description": "Unauthorized — `authentication_error`. Invalid or missing API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "403": { "description": "Forbidden — `permission_error`. API key lacks access to the requested resource.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "404": { "description": "Not Found — `not_found_error`. Model does not exist or is not accessible.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "413": { "description": "Payload Too Large — `request_too_large`. Request exceeds the maximum allowed size.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "429": { "description": "Too Many Requests — `rate_limit_error`. Rate limit exceeded.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "500": { "description": "Internal Server Error — `api_error`. Unexpected issue on the server side.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "501": { "description": "Not Implemented — `not_implemented_error`. Currently returned when `stream: true` is set, until streaming support lands (PRD Phase 4).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "503": { "description": "Service Unavailable — `overloaded_error`. Backend is temporarily over capacity.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import SambaNova from 'sambanova';\n\nconst client = new SambaNova({\n apiKey: process.env['SAMBANOVA_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.messages.create({\n max_tokens: 1024,\n messages: [{ content: 'Hello, Claude!', role: 'user' }],\n model: 'DeepSeek-V3.1',\n});\n\nconsole.log(message);" }, { "lang": "Python", "source": "import os\nfrom sambanova import SambaNova\n\nclient = SambaNova(\n api_key=os.environ.get(\"SAMBANOVA_API_KEY\"), # This is the default and can be omitted\n)\nfor message in client.messages.create(\n max_tokens=1024,\n messages=[{\n \"content\": \"Hello, Claude!\",\n \"role\": \"user\",\n }],\n model=\"DeepSeek-V3.1\",\n):\n print(message)" } ] } }, "/messages/count_tokens": { "post": { "operationId": "countMessageTokens", "tags": ["Messages"], "summary": "Count tokens for a message request", "description": "Anthropic `count_tokens` compatible endpoint. Returns the number of input tokens that would be consumed by a `POST /messages` call with the same prompt content (system, messages, tools, tool_choice). Authentication accepts either the bearer `Authorization: Bearer ` header (SambaNova SDK default) or the `x-api-key` header (Anthropic SDK default); the same API key is used in both cases.", "security": [{ "api_key": [] }, { "x_api_key": [] }], "parameters": [ { "in": "header", "name": "anthropic-version", "required": false, "description": "Anthropic API version header sent by the official `anthropic` SDK. Accepted (any value) but currently has no effect on response shape - included for drop-in SDK compatibility.", "schema": { "title": "Anthropic Version", "type": "string", "example": "2023-06-01" } } ], "requestBody": { "required": true, "description": "Token counting parameters (subset of message creation parameters).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageCountTokensRequest" } } } }, "responses": { "200": { "description": "Successful response. Returns the input token count.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageCountTokensResponse" } } } }, "400": { "description": "Bad Request — `invalid_request_error`. Returned for missing or invalid parameters, unsupported feature flags, unsupported tool types, image source `type:\"url\"`, `document` content blocks, or non-object request bodies.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "401": { "description": "Unauthorized — `authentication_error`. Invalid or missing API key.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "403": { "description": "Forbidden — `permission_error`. API key lacks access to the requested resource.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "404": { "description": "Not Found — `not_found_error`. Model does not exist or is not accessible.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "413": { "description": "Payload Too Large — `request_too_large`. Request exceeds the maximum allowed size.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "429": { "description": "Too Many Requests — `rate_limit_error`. Rate limit exceeded.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "500": { "description": "Internal Server Error — `api_error`. Unexpected issue on the server side.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } }, "503": { "description": "Service Unavailable — `overloaded_error`. Backend is temporarily over capacity.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageErrorResponse" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import SambaNova from 'sambanova';\n\nconst client = new SambaNova({\n apiKey: process.env['SAMBANOVA_API_KEY'], // This is the default and can be omitted\n});\n\nconst messageCountTokensResponse = await client.messages.countTokens({\n messages: [{ content: 'Hello, Claude!', role: 'user' }],\n model: 'DeepSeek-V3.1',\n});\n\nconsole.log(messageCountTokensResponse.input_tokens);" }, { "lang": "Python", "source": "import os\nfrom sambanova import SambaNova\n\nclient = SambaNova(\n api_key=os.environ.get(\"SAMBANOVA_API_KEY\"), # This is the default and can be omitted\n)\nmessage_count_tokens_response = client.messages.count_tokens(\n messages=[{\n \"content\": \"Hello, Claude!\",\n \"role\": \"user\",\n }],\n model=\"DeepSeek-V3.1\",\n)\nprint(message_count_tokens_response.input_tokens)" } ] } }, "/embeddings": { "post": { "operationId": "createEmbedding", "tags": ["Embeddings"], "summary": "Create embeddings", "security": [{ "api_key": [] }], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddingsRequest" } } }, "description": "Texts to embed and parameters", "required": true }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddingsResponse" } } } }, "400": { "description": "Bad Request - Missing or invalid parameters", "content": { "text/plain": { "schema": { "type": "string", "example": "Invalid request body: - missing property 'model'\"" } }, "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/GeneralError" }, { "$ref": "#/components/schemas/SimpleError" } ] }, "examples": { "missing_model": { "summary": "No model parameter provided", "value": { "error": { "message": "you must provide a model parameter", "type": "invalid_request_error", "param": null, "code": null }, "request_id": "a4fa849e" } }, "invalid_json": { "summary": "Malformed JSON body", "value": { "error": { "code": null, "message": "We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. A JSON payload is expected, but what was sent was not valid JSON.)", "param": null, "type": "invalid_request_error" }, "request_id": "3f7db127" } }, "simple": { "summary": "Simple error (unhandled cases)", "value": { "error": "Model name is required" } } } } } }, "401": { "description": "Unauthorized access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" }, "examples": { "invalid_api_key": { "summary": "Invalid API key provided", "value": { "error": { "message": "Incorrect API key provided: *****. You can find your API key at https://cloud.sambanova.ai/apis.", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" }, "request_id": "d79vcq57os633dverhi0" } }, "missing_api_key": { "summary": "No API key provided", "value": { "error": { "message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY).", "type": "invalid_request_error", "param": null, "code": null }, "request_id": "d7a0dct7os633dvesi60" } } } } } }, "404": { "description": "Not found - model does not exist or wrong endpoint called", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/GeneralError" }, { "$ref": "#/components/schemas/SimpleError" } ] }, "examples": { "model_not_found": { "summary": "Model does not exist or is not accessible", "value": { "error": { "code": "model_not_found", "message": "The model `abc` does not exist or you do not have access to it.", "param": "model", "type": "invalid_request_error" }, "request_id": "887a8227" } }, "simple": { "summary": "Simple error (unhandled cases e.g. wrong endpoint)", "value": { "error": "Not found" } } } } } }, "408": { "description": "Request timeout", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "410": { "description": "Gone - model is no longer available (deprecated or removed)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" } } } }, "500": { "description": "Internal Server Error. Unexpected issue on server side.", "content": { "text/plain": { "schema": { "type": "string" } } } }, "503": { "description": "Service Temporarily Unavailable", "content": { "text/plain": { "schema": { "type": "string", "example": "Service Temporarily Unavailable" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import SambaNova from 'sambanova';\n\nconst client = new SambaNova({\n apiKey: process.env['SAMBANOVA_API_KEY'], // This is the default and can be omitted\n});\n\nconst embeddingsResponse = await client.embeddings.create({\n input: ['text to embed number 1', 'text to embed number 2'],\n model: 'E5-Mistral-7B-Instruct',\n});\n\nconsole.log(embeddingsResponse.data);" }, { "lang": "Python", "source": "import os\nfrom sambanova import SambaNova\n\nclient = SambaNova(\n api_key=os.environ.get(\"SAMBANOVA_API_KEY\"), # This is the default and can be omitted\n)\nembeddings_response = client.embeddings.create(\n input=[\"text to embed number 1\", \"text to embed number 2\"],\n model=\"E5-Mistral-7B-Instruct\",\n)\nprint(embeddings_response.data)" } ] } }, "/audio/transcriptions": { "post": { "operationId": "createTranscription", "tags": ["Audio"], "summary": "Transcribes audio into the input language.", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/TranscriptionRequest" } } }, "description": "Audio to transcribe and parameters", "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/TranscriptionResponse" }, { "$ref": "#/components/schemas/TranscriptionStreamResponse" } ] } }, "text/plain": { "schema": { "type": "string", "example": "It's a sound effect of a bell chiming, specifically a church bell." } } } }, "400": { "description": "Bad Request - Missing or invalid parameters", "content": { "text/plain": { "schema": { "type": "string", "example": "Invalid request body: - missing property 'model'\"" } }, "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/GeneralError" }, { "$ref": "#/components/schemas/SimpleError" } ] }, "examples": { "missing_model": { "summary": "No model parameter provided", "value": { "error": { "message": "you must provide a model parameter", "type": "invalid_request_error", "param": null, "code": null }, "request_id": "a4fa849e" } }, "simple": { "summary": "Simple error (unhandled cases)", "value": { "error": "Model name is required" } } } } } }, "401": { "description": "Unauthorized access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" }, "examples": { "invalid_api_key": { "summary": "Invalid API key provided", "value": { "error": { "message": "Incorrect API key provided: *****. You can find your API key at https://cloud.sambanova.ai/apis.", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" }, "request_id": "d79vcq57os633dverhi0" } }, "missing_api_key": { "summary": "No API key provided", "value": { "error": { "message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY).", "type": "invalid_request_error", "param": null, "code": null }, "request_id": "d7a0dct7os633dvesi60" } } } } } }, "404": { "description": "Not found - model does not exist or wrong endpoint called", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/GeneralError" }, { "$ref": "#/components/schemas/SimpleError" } ] }, "examples": { "model_not_found": { "summary": "Model does not exist or is not accessible", "value": { "error": { "code": "model_not_found", "message": "The model `abc` does not exist or you do not have access to it.", "param": "model", "type": "invalid_request_error" }, "request_id": "887a8227" } }, "simple": { "summary": "Simple error (unhandled cases e.g. wrong endpoint)", "value": { "error": "Not found" } } } } } }, "408": { "description": "Request timeout", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "410": { "description": "Gone - model is no longer available (deprecated or removed)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" } } } }, "500": { "description": "Internal Server Error. Unexpected issue on server side.", "content": { "text/plain": { "schema": { "type": "string" } } } }, "503": { "description": "Service Temporarily Unavailable", "content": { "text/plain": { "schema": { "type": "string", "example": "Service Temporarily Unavailable" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import fs from 'fs';\nimport SambaNova from 'sambanova';\n\nconst client = new SambaNova({\n apiKey: process.env['SAMBANOVA_API_KEY'], // This is the default and can be omitted\n});\n\nconst transcription = await client.audio.transcriptions.create({\n file: fs.createReadStream('path/to/file'),\n model: 'Whisper-Large-v3',\n});\n\nconsole.log(transcription);" }, { "lang": "Python", "source": "import os\nfrom sambanova import SambaNova\n\nclient = SambaNova(\n api_key=os.environ.get(\"SAMBANOVA_API_KEY\"), # This is the default and can be omitted\n)\nfor transcription in client.audio.transcriptions.create(\n file=b\"Example data\",\n model=\"Whisper-Large-v3\",\n):\n print(transcription)" } ] } }, "/audio/translations": { "post": { "operationId": "createTranslation", "tags": ["Audio"], "summary": "Translate audio into English.", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/TranslationRequest" } } }, "description": "Audio to translate and parameters", "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/TranslationResponse" }, { "$ref": "#/components/schemas/TranslationStreamResponse" } ] } }, "text/plain": { "schema": { "type": "string", "example": "It's a sound effect of a bell chiming, specifically a church bell." } } } }, "400": { "description": "Bad Request - Missing or invalid parameters", "content": { "text/plain": { "schema": { "type": "string", "example": "Invalid request body: - missing property 'model'\"" } }, "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/GeneralError" }, { "$ref": "#/components/schemas/SimpleError" } ] }, "examples": { "missing_model": { "summary": "No model parameter provided", "value": { "error": { "message": "you must provide a model parameter", "type": "invalid_request_error", "param": null, "code": null }, "request_id": "a4fa849e" } }, "simple": { "summary": "Simple error (unhandled cases)", "value": { "error": "Model name is required" } } } } } }, "401": { "description": "Unauthorized access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" }, "examples": { "invalid_api_key": { "summary": "Invalid API key provided", "value": { "error": { "message": "Incorrect API key provided: *****. You can find your API key at https://cloud.sambanova.ai/apis.", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" }, "request_id": "d79vcq57os633dverhi0" } }, "missing_api_key": { "summary": "No API key provided", "value": { "error": { "message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY).", "type": "invalid_request_error", "param": null, "code": null }, "request_id": "d7a0dct7os633dvesi60" } } } } } }, "404": { "description": "Not found - model does not exist or wrong endpoint called", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/GeneralError" }, { "$ref": "#/components/schemas/SimpleError" } ] }, "examples": { "model_not_found": { "summary": "Model does not exist or is not accessible", "value": { "error": { "code": "model_not_found", "message": "The model `abc` does not exist or you do not have access to it.", "param": "model", "type": "invalid_request_error" }, "request_id": "887a8227" } }, "simple": { "summary": "Simple error (unhandled cases e.g. wrong endpoint)", "value": { "error": "Not found" } } } } } }, "408": { "description": "Request timeout", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "410": { "description": "Gone - model is no longer available (deprecated or removed)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } }, "429": { "description": "Too Many Requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeneralError" } } } }, "500": { "description": "Internal Server Error. Unexpected issue on server side.", "content": { "text/plain": { "schema": { "type": "string" } } } }, "503": { "description": "Service Temporarily Unavailable", "content": { "text/plain": { "schema": { "type": "string", "example": "Service Temporarily Unavailable" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import fs from 'fs';\nimport SambaNova from 'sambanova';\n\nconst client = new SambaNova({\n apiKey: process.env['SAMBANOVA_API_KEY'], // This is the default and can be omitted\n});\n\nconst translation = await client.audio.translations.create({\n file: fs.createReadStream('path/to/file'),\n model: 'Whisper-Large-v3',\n});\n\nconsole.log(translation);" }, { "lang": "Python", "source": "import os\nfrom sambanova import SambaNova\n\nclient = SambaNova(\n api_key=os.environ.get(\"SAMBANOVA_API_KEY\"), # This is the default and can be omitted\n)\nfor translation in client.audio.translations.create(\n file=b\"Example data\",\n model=\"Whisper-Large-v3\",\n):\n print(translation)" } ] } }, "/models": { "get": { "operationId": "getModelList", "tags": ["Models"], "summary": "Get environment's available model list metadata", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelMetadataList" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import SambaNova from 'sambanova';\n\nconst client = new SambaNova({\n apiKey: process.env['SAMBANOVA_API_KEY'], // This is the default and can be omitted\n});\n\nconst modelsResponse = await client.models.list();\n\nconsole.log(modelsResponse.data);" }, { "lang": "Python", "source": "import os\nfrom sambanova import SambaNova\n\nclient = SambaNova(\n api_key=os.environ.get(\"SAMBANOVA_API_KEY\"), # This is the default and can be omitted\n)\nmodels_response = client.models.list()\nprint(models_response.data)" } ] } }, "/models/{model_id}": { "get": { "operationId": "getModel", "tags": ["Models"], "summary": "Get environment's available model metadata", "parameters": [ { "in": "path", "name": "model_id", "required": true, "schema": { "title": "Model Id", "type": "string", "description": "model id to get metadata" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelMetadata" } } }, "description": "Successful Response" }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import SambaNova from 'sambanova';\n\nconst client = new SambaNova({\n apiKey: process.env['SAMBANOVA_API_KEY'], // This is the default and can be omitted\n});\n\nconst modelResponse = await client.models.retrieve('model_id');\n\nconsole.log(modelResponse.id);" }, { "lang": "Python", "source": "import os\nfrom sambanova import SambaNova\n\nclient = SambaNova(\n api_key=os.environ.get(\"SAMBANOVA_API_KEY\"), # This is the default and can be omitted\n)\nmodel_response = client.models.retrieve(\n \"model_id\",\n)\nprint(model_response.id)" } ] } } }, "security": [{ "api_key": [] }] }