Scaleway logo
OpenAI Compatible API

ResponseAPIInputContentPart

type
​string · enum · required

Type of content. (Required).

Enum values:
input_text
input_image
input_file
text
​string

Text content.

detail
​string · enum

Detail level of the image provided to the model.

Enum values:
high
low
auto
Default: auto
image_url
​string

URL of a remote image or encoding in base64 of a local image.

See How to query vision modelsOpen in new context for code snippets using the openai Python client, and guidance for encoding local images.

file_data
​string

Content of a file.

file_url
​string

URL of a remote file.

ResponseAPIInputList

role
​string · enum · required

Role providing the content input.

Enum values:
system
developer
user
assistant
​ResponseAPIInputContentPart[]

List of input contents of different type, each compatible with different fields:

input_text: Requires text field.

input_image: Requires detail and image_url fields.

input_file: Requires file_data or file_url field. Optionally, filename can be provided.

status
​string · enum

Status of the response.

Enum values:
in_progress
completed
incomplete
type
​string

Type of the content input. Always set to message.

ResponseAPIAnnotation

ResponseAPITool

type
​string · enum · required

Type of tool object, always set to function.

Enum values:
function
name
​string · required

Name of the function to be called. Must contain only a-z, A-Z, 0-9, underscores and dashes, with a maximum length of 64 characters.

description
​string

Description of the function. This helps the model choose the right function when needed.

​FunctionParameters

Parameters of the function, described as a JSON schema object. See How to use function callingOpen in new context for examples, and the JSON schema referenceOpen in new context for documentation about the format. Omitting parameters defines a function with an empty parameter list.

strict
​boolean

Defines whether to enforce strict schema adherence when generating a function call. If set to true, the model will follow the exact schema defined in the parameters field. Currently, even if set true this parameter will be ignored and act as if set to false. We recommend you check output schema before calling any functions or tools.

Default: false

ResponseAPIOutputContentPart

type
​string · enum

Type of content. Always set to output_text.

Enum values:
output_text
text
​string

Text content.

​ResponseAPIAnnotation[]

Annotations of the text output, such as citations or path to a file.

ResponseAPIOutputList

role
​string · enum

Role generating the content output. Always set to assistant.

Enum values:
assistant
type
​string · enum

List of outputs of different type, each also outputting different fields:

message: outputs content field

function_call: outputs call_id, name and arguments fields

Enum values:
message
function_call
reasoning
id
​string

UUID of the mesage within a response.

status
​string · enum

Status of the response.

Enum values:
in_progress
completed
incomplete

List of text output contents.

call_id
​string

UUID of the function tool call.

name
​string

Name the function to execute.

arguments
​string

Arguments to pass to the function, formatted as a JSON string.

Example: {"city": "Paris","timezone": "UTC+2"}

ResponseAPIUsage

input_tokens
​integer

Number of input tokens.

​object

Breakdown of input tokens by type.

output_tokens
​integer

Number of output tokens.

​object

Breakdown of output tokens by type.

total_tokens
​integer

Total number of tokens (input and output).

ChatCompletionMessageToolCall

id
​string

UUID of the tool call.

type
​string · enum

Type of tool call, always set to function.

Enum values:
function
​object

Function to call, identified by the model.

ChatCompletionMessageToolCalls

List of tool calls required by the model, such as function calls.

id
​string

UUID of the tool call.

type
​string · enum

Type of tool call, always set to function.

Enum values:
function
​object

Function to call, identified by the model.

ChatCompletionRequestMessageContentPart

type
​string · enum · required

Type of content. image_url and input_audio are only supported with user role.

Enum values:
text
image_url
input_audio
text
​string

Text content. Required if type is set to text.

​object
​object

ChatCompletionRequestMessage

role
​string · enum · required

Role of the message's author.

Enum values:
system
user
assistant
tool
content
​string

Content of a message as string. Required for all roles, except assistant if tool_calls is specified instead.

Content of a message as array of content parts. Required for all roles, except assistant if tool_calls is specified instead.

List of tool calls required by the model. Can only be used with assistant if content is not specified.

tool_call_id
​string

UUID of the tool call. Must only be used with tool role.

ChatCompletionResponseMessage

Message generated by the model.
role
​string · enum

Role of the message's author, always set to assistant in the response.

Enum values:
assistant
content
​string

Content of the message.

reasoning_content
​string

Reasoning content generated for this message.

List of tool calls required by the model, such as function calls.

ChatCompletionStreamOptions

An object containing parameters that modify the behavior of stream responses. Can only be used if `stream` is set to `true`.
include_usage
​boolean

Defines whether a usage field is included in a stream. If set, an additional chunk will be streamed before the data: [DONE] message. The usage field on this chunk shows the token usage statistics for the complete stream.

ChatCompletionTokenLogprob

token
​string

Token generated.

logprob
​number

Log probability of generating this token, if it is among the top 20 most likely tokens. Otherwise, the value -9999.0 is used to mean that the token is very unlikely.

bytes
​integer[]

List of integers representing the UTF-8 bytes (in decimal format) representation of a token. Since some characters may be represented by multiple tokens, this representation can be combined to represent the corresponding character in UTF-8.

​object[]

List of most probable next tokens and their log probability.

ChatCompletionTool

type
​string · enum · required

Type of tool object, always set to function.

Enum values:
function
​FunctionObject · required

ChatCompletionToolChoiceOption

string · enum
Enum values:
none
auto
required

Defines whether a model can call tools, and if so, and which ones.

none: model will not call any tools, and only generate a message.

auto: model can choose either to generate a message, or to call one or multiple tools.

required: model must call one or multiple tools.

Default: none when no tools are present, otherwise auto.

An object can also be provided to specify a tool that the model must call. Object format must be:

{"type": "function", "function": {"name": "function_name_as_provided_in_tools"}}

ChatCompletionResponseChoice

index
​integer

Index of the choice in the list of choices.

Message generated by the model.

​object

Object containing log probability information for each token in a generated response.

finish_reason
​string · enum

Reason the model stopped generating tokens.

stop: model successfully reached the end of its answer, or a provided stop sequence

length: maximum number of output tokens was reached, blocking further generation

tool_calls: model needed to call a tool

Enum values:
stop
length
tool_calls

ChatCompletionUsage

prompt_tokens
​integer

Number of input tokens.

total_tokens
​integer

Total number of tokens (input and output).

completion_tokens
​integer

Number of output tokens.

​object

Breakdown of output tokens by type.

​object

Breakdown of input tokens by type.

CreateResponse

id
​string

UUID of the response.

object
​string · enum

Type of response object, always set to chat.completion.

Enum values:
response
created_at
​integer

Timestamp when the response was generated (Unix format, in seconds).

status
​string · enum

Status of the response.

Enum values:
in_progress
completed
incomplete
model
​string

Unique identifier of the model.

​ResponseAPIOutputList[] · minItems: 1

List of outputs generated by the model as response.

​object

Configuration of the response format, either plain text or JSON structured data.

​ResponseAPIUsage

CreateChatCompletionResponse

id
​string

UUID of the response.

object
​string · enum

Type of response object, always set to chat.completion.

Enum values:
chat.completion
created
​integer

Timestamp when the response was generated (Unix format, in seconds).

model
​string

Unique identifier of the model.

List of chat completion variations. Defaults to only 1 choice, but can be increased by setting a value for n in the request.

​ChatCompletionUsage

CreateEmbeddingResponse

id
​integer

UUID of the response.

object
​string · enum

Type of response object, always set to list.

Enum values:
list
created
​integer

Timestamp when the response was generated (Unix format, in seconds).

model
​string

Unique identifier of the model.

​Embedding[]

List of embeddings.

​object

Usage information generated by this request.

Embedding

index
​integer

Index of the embedding in the list of embeddings.

object
​string · enum

Type of the response object, always set to embedding.

Enum values:
embedding
embedding
​number[]

Embedding vector, represented as a list of floating point values. The length of a vector is equal to the number of dimensions of the model.

CreateRerankResponse

id
​integer

UUID of the response.

model
​string

Unique identifier of the model.

​Ranking[]

List of documents sorted by relevance.

​object

Usage information generated by this request.

Ranking

index
​integer

Index of the document in the initial request.

relevance_score
​number

Document's relevance to answering the query.

​object

Document sent in the request.

CreateAudioTranscriptionResponse

text
​integer

Transcribed text.

​object

Usage information generated by this request, either in tokens or duration depending on how the model is billed.

Batch

id
​string

UUID of the batch.

object
​string · enum

Type of batch object, always set to batch.

Enum values:
batch
endpoint
​string

Path used to process requests in the batch.

model
​string

Model used to process the batch

​object

Error object

input_file_id
​string

URL of the input file.

completion_window
​string

Time range during which the batch should be processed.

status
​string

Status of the batch.

output_file_id
​string

URL of the input file.

error_file_id
​string

URL of the input file.

created_at
​integer

Timestamp when the batch was created (Unix format, in seconds).

in_progress_at
​integer

Timestamp when the batch processing started (Unix format, in seconds).

expires_at
​integer

Timestamp when the batch will expire (Unix format, in seconds).

finalizing_at
​integer

Timestamp when the batch started finalizing (Unix format, in seconds).

completed_at
​integer

Timestamp when the batch was completed (Unix format, in seconds).

failed_at
​integer

Timestamp when the batch failed (Unix format, in seconds).

expired_at
​integer

Timestamp when the batch expired (Unix format, in seconds).

cancelling_at
​integer

Timestamp when the batch started cancelling (Unix format, in seconds).

cancelled_at
​integer

Timestamp when the batch was cancelled (Unix format, in seconds).

​object

Number of requests by status.

​object

Usage information generated by the requests of the batch, either in tokens or duration depending on how the model is billed.

ListBatchResponse

object
​string · enum

Type of response object, always set to list.

Enum values:
list
​Batch[]

List of batches.

first_id
​string

UUID of first batch in the response.

last_id
​string

UUID of last batch in the response.

has_more
​boolean

Defines whether there are more results to retrieve not returned by this query.

ResponseAPIFunctionObject

type
​string · enum · required

Type of tool object, always set to function.

Enum values:
function
name
​string · required

Name of the function to be called. Must contain only a-z, A-Z, 0-9, underscores and dashes, with a maximum length of 64 characters.

description
​string

Description of the function. This helps the model choose the right function when needed.

​FunctionParameters

Parameters of the function, described as a JSON schema object. See How to use function callingOpen in new context for examples, and the JSON schema referenceOpen in new context for documentation about the format. Omitting parameters defines a function with an empty parameter list.

strict
​boolean

Defines whether to enforce strict schema adherence when generating a function call. If set to true, the model will follow the exact schema defined in the parameters field. Currently, even if set true this parameter will be ignored and act as if set to false. We recommend you check output schema before calling any functions or tools.

Default: false

FunctionObject

name
​string · required

Name of the function to be called. Must contain only a-z, A-Z, 0-9, underscores and dashes, with a maximum length of 64 characters.

description
​string

Description of the function. This helps the model choose the right function when needed.

​FunctionParameters

Parameters of the function, described as a JSON schema object. See How to use function callingOpen in new context for examples, and the JSON schema referenceOpen in new context for documentation about the format. Omitting parameters defines a function with an empty parameter list.

strict
​boolean

Defines whether to enforce strict schema adherence when generating a function call. If set to true, the model will follow the exact schema defined in the parameters field. Currently, even if set true this parameter will be ignored and act as if set to false. We recommend you check output schema before calling any functions or tools.

Default: false

FunctionParameters

Parameters of the function, described as a JSON schema object. See [How to use function calling](https://www.scaleway.com/en/docs/generative-apis/how-to/use-function-calling/) for examples, and 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.

ListModelsResponse

object
​string · enum

Type of response object, always set to list.

Enum values:
list
​Model[]

List of models.

Model

id
​string

Unique identifier of the model.

object
​string · enum

Object type. Always set to model.

Enum values:
model
created
​integer

Timestamp when the model was created (Unix format, in seconds).

owned_by
​string

Name of the organization that created the model (i.e. the model provider).

ParallelToolCalls

boolean

Defines whether the model can call multiple tools. Currently, even if set false this parameter will be ignored and act as if set to true.

Only specific modelsOpen in new context can call multiple tools in a single response.

Default value: true

MaxOutputTokens

integer

Maximum number of output tokens that can be generated for a completion. Different default maximum valuesOpen in new context are enforced for each model, to avoid edge cases where tokens are generated indefinitely. These values are not enforced in Managed InferenceOpen in new context.

ResponseFormatChatCompletion

Output format specification. Using `{ "type": "json_schema", "json_schema": {...} }` enables the model to output only a valid JSON following the provided schema specification. Deprecated. Using `{ "type": "json_object" }` enables `JSON mode` that should not be used anymore. See [How to use structured outputs](https://www.scaleway.com/en/docs/generative-apis/how-to/use-structured-outputs/) for code snippets using `openai` Python client and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
type
​string · enum

Type of response object.

Enum values:
text
json_schema
json_object
json_schema
​object

Schema the response object should follow in JSON format. This field can only be used if type is set to json_schema.

ResponseFormatResponseAPI

Output format specification. Using `{ "type": "text"}` ensures the model enables output text (default behavior). Using `{ "type": "json_schema", "name": ..., "schema": {...}, "description": ...,"strict": true}` enables the model to output only valid JSON following the provided schema specification. Deprecated. Using `{ "type": "json_object" }` enables `JSON mode`, and should no longer be used. See [How to use structured outputs](https://www.scaleway.com/en/docs/generative-apis/how-to/use-structured-outputs/) for code snippets using the `openai` Python client, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
type
​string · enum · required

Type of response object. The properties name, schema, description and strict can only be used if type is set to json_schema.

Enum values:
text
json_schema
json_object
name
​string · required

Name of the response format. Must only contain alphanumeric characters, underscores and dashes.

schema
​object · required

Schema the response object should follow in JSON format. This field can only be used if type is set to json_schema. Learn moreOpen in new context

description
​string

Description of the response format. This helps the model generate a response that follows the desired structure.

strict
​boolean

Defines whether to enforce strict schema adherence when generating structured output. Currently, only true is supported.

Default: true

StopConfiguration

string

String, or array of strings, that when encountered in the generated text will stop the model from generating further output tokens. The generated text will not return any of the specified stop sequences. A maximum of 4 sequences can be provided.

Default: null

Temperature

number · min: 0 · max: 2

Value between 0 and 2 which increases randomness in token generation (e.g. encourages content "creativity" instead of "predictability").

temperature:0 means the distribution learned by the model will be used directly, favoring a subset of the most probable tokens at each generation step.

temperature>0 means randomness is added to the learnt distribution, so that tokens with a lower probability can also be generated.

temperature>=1 means added randomness will be so high, that almost all tokens are equally probable, leading the model to potentially mix languages.

The ideal temperature value depends on the use case and model. We recommend setting temperature to the recommended value for each model, as shown in Console Playground (these values are used by default).

Note that temperature does not affect request reproducibility (only affected by the seed parameter). With the same seed and temperature, two identical requests to a model will generate the same response.

TopP

number · min: 0 · max: 1

Value between 0 and 1 which increases the proportion of token vocabulary considered during generation (0 cannot be used).

top_p:0.9 means the next token will be chosen from the 90% most probable tokens at each generation step.

We recommend setting top_p to the recommended value for each model, as shown in Console Playground (these values are used by default).

ProjectId

string

The ID of the Project you want to target. If this value is not provided, your default Project will be used.

Specifying this value allows you to limit access through IAM policies, or to allocate consumption and billing to a specific project.