Overview
Presets endpointsAvailable Operations
- List - List presets
- Get - Get a preset
- CreatePresetsChatCompletions - Create a preset from a chat-completions request body
- CreatePresetsMessages - Create a preset from a messages request body
- CreatePresetsResponses - Create a preset from a responses request body
- ListVersions - List versions of a preset
- GetVersion - Get a specific version of a preset
List
Lists all presets for the authenticated user, ordered by most recently updated first.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
offset | optionalnullable.OptionalNullable[int64] | :heavy_minus_sign: | Number of records to skip for pagination | 0 |
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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
Get
Retrieves a preset by its slug with its currently designated version inline.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
slug | string | :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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
slug | string | :heavy_check_mark: | URL-safe slug identifying the preset. Created if it does not exist. | my-preset |
chatRequest | components.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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.ForbiddenResponseError | 403 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.ConflictResponseError | 409 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
slug | string | :heavy_check_mark: | URL-safe slug identifying the preset. Created if it does not exist. | my-preset |
messagesRequest | components.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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.ForbiddenResponseError | 403 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.ConflictResponseError | 409 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
slug | string | :heavy_check_mark: | URL-safe slug identifying the preset. Created if it does not exist. | my-preset |
responsesRequest | components.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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.ForbiddenResponseError | 403 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.ConflictResponseError | 409 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
ListVersions
Lists all versions of a preset, ordered by version number ascending (oldest first).Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
slug | string | :heavy_check_mark: | URL-safe slug identifying the preset. | my-preset |
offset | optionalnullable.OptionalNullable[int64] | :heavy_minus_sign: | Number of records to skip for pagination | 0 |
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, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |
GetVersion
Retrieves a specific version of a preset by its slug and version number.Example Usage
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx | context.Context | :heavy_check_mark: | The context to use for the request. | |
slug | string | :heavy_check_mark: | URL-safe slug identifying the preset. | my-preset |
version | string | :heavy_check_mark: | Version number of the preset. | 1 |
opts | []operations.Option | :heavy_minus_sign: | The options for this request. |
Response
*components.GetPresetVersionResponse, errorErrors
| Error Type | Status Code | Content Type |
|---|---|---|
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | */* |