Overview
Presets endpointsAvailable Operations
- 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
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 | */* |