Skip to main content

Overview

Presets endpoints

Available Operations

List

Lists all presets for the authenticated user, ordered by most recently updated first.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
offsetoptionalnullable.OptionalNullable[int64]:heavy_minus_sign:Number of records to skip for pagination0
limit*int64:heavy_minus_sign:Maximum number of records to return (max 100)50
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.ListPresetsResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

Get

Retrieves a preset by its slug with its currently designated version inline.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
slugstring:heavy_check_mark:URL-safe slug identifying the preset.my-preset
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.GetPresetResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

CreatePresetsChatCompletions

Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. messages, stream, prompt) are silently ignored.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
slugstring:heavy_check_mark:URL-safe slug identifying the preset. Created if it does not exist.my-preset
chatRequestcomponents.ChatRequest:heavy_check_mark:N/A{
“max_tokens”: 150,
“messages”: [
{
“content”: “You are a helpful assistant.”,
“role”: “system”
},
{
“content”: “What is the capital of France?”,
“role”: “user”
}
],
“model”: “openai/gpt-4”,
“temperature”: 0.7
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.CreatePresetFromInferenceResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.ForbiddenResponseError403application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.ConflictResponseError409application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

CreatePresetsMessages

Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. messages, stream, prompt) are silently ignored.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
slugstring:heavy_check_mark:URL-safe slug identifying the preset. Created if it does not exist.my-preset
messagesRequestcomponents.MessagesRequest:heavy_check_mark:N/A{
“max_tokens”: 1024,
“messages”: [
{
“content”: “Hello, how are you?”,
“role”: “user”
}
],
“model”: “anthropic/claude-4.5-sonnet-20250929”,
“temperature”: 0.7
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.CreatePresetFromInferenceResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.ForbiddenResponseError403application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.ConflictResponseError409application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

CreatePresetsResponses

Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. messages, stream, prompt) are silently ignored.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
slugstring:heavy_check_mark:URL-safe slug identifying the preset. Created if it does not exist.my-preset
responsesRequestcomponents.ResponsesRequest:heavy_check_mark:N/A{
“input”: [
{
“content”: “Hello, how are you?”,
“role”: “user”,
“type”: “message”
}
],
“model”: “anthropic/claude-4.5-sonnet-20250929”,
“temperature”: 0.7,
“tools”: [
{
“description”: “Get the current weather in a given location”,
“name”: “get_current_weather”,
“parameters”: {
“properties”: {
“location”: {
“type”: “string”
}
},
“type”: “object”
},
“type”: “function”
}
],
“top_p”: 0.9
}
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.CreatePresetFromInferenceResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.ForbiddenResponseError403application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.ConflictResponseError409application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

ListVersions

Lists all versions of a preset, ordered by version number ascending (oldest first).

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
slugstring:heavy_check_mark:URL-safe slug identifying the preset.my-preset
offsetoptionalnullable.OptionalNullable[int64]:heavy_minus_sign:Number of records to skip for pagination0
limit*int64:heavy_minus_sign:Maximum number of records to return (max 100)50
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.ListPresetVersionsResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

GetVersion

Retrieves a specific version of a preset by its slug and version number.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
slugstring:heavy_check_mark:URL-safe slug identifying the preset.my-preset
versionstring:heavy_check_mark:Version number of the preset.1
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.GetPresetVersionResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*