Skip to main content
POST

Authorizations

Authorization
string
header
required

Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.

Headers

content-type
string
required

Body

application/json
messages
OpenAIMessage · object[]
required

The messages to generate chat completions for.

Required array length: 1 - 300 elements
max_completion_tokens
integer
default:2000

An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.

model
string

The language model to use. Model availability varies by CDF project and cluster. If not specified, the project's default model is used. Valid values are the id values returned by GET /ai/openai/models.

Example:

"azure/gpt-4.1"

response_format
OpenAIResponseFormat · object

The format that the model must output.

stream
boolean
default:false

If true, the response is streamed back incrementally using server-sent events.

temperature
number
default:0

Sampling temperature. Higher values produce more random output, lower values produce more deterministic output. Models that do not support temperature will ignore this field.

tool_choice

Controls which tool the model calls, if any. none disables tool calls, auto lets the model decide, required forces a tool call. Use the object form to force a specific function.

tools
OpenAIChatCompletionsTool · object[]

A list of tools the model can use.

Required array length: 1 - 128 elements

Response

Successful Response

choices
OpenAIChoice · object[]
required

The list of generated completion choices.

created
integer
required

Unix timestamp of when the completion was created.

id
string
required

A unique identifier for the chat completion.

model
string
required

The model used to generate the response.

usage
OpenAIUsage · object
required

Token usage statistics for the request.

object
string
default:chat.completion

The object type. Always chat.completion.

Allowed value: "chat.completion"
Last modified on October 6, 2026