Claude Sonnet 4.6
PopularAnthropic · Text · Image → Text
Balanced Claude model — strong reasoning at lower latency and cost.
claude-sonnet-4-6Workflow: claude/v1/messagesOverview
Alongside the unified model APIs, we expose compatibility APIs that take each vendor's original parameters exactly as the vendor defines them — nothing renamed, nothing reshaped on the way through.
That makes them the shortest path onto Picsart if you already work with the vendor directly: the request bodies you've already written keep working as they are. You keep their parameter names and defaults, and you get the vendor's full parameter set rather than the subset that is shared across every model.
The cost is that a request is written for one vendor — switching models later means rewriting it, and results come back in the vendor's own shape. When you'd rather write once and change models freely, use the unified API.
Make a request
Call the workflow with ai.apis.run() in TypeScript, or hit /workflows/{workflow}/execute directly — params is passed through untouched either way.
These endpoints are addressed by workflow name rather than model id: the one in this model's header, since one model runs as one workflow. Authentication is unchanged — your Picsart API key as a bearer token (see Authentication).
import { createClient, ApiRunMode } from '@picsart/ai-sdk';
const ai = createClient({
apiKey: process.env.PICSART_API_KEY,
apiUrl: 'https://api.picsart.com',
});
// Calls the 'claude/v1/messages' workflow directly — params are sent as-is.
const { result, usage } = await ai.apis.run('claude/v1/messages', {
model: "claude-opus-4-8",
messages: [
{
role: "user",
content: []
}
]
}, {
mode: ApiRunMode.SYNC,
});
console.log(result); // workflow-specific output
console.log(usage?.credits); // credits chargedParameters
10 parameters, sent inside params. These are the vendor's own names, so they line up one-for-one with the vendor's documentation. Required ones must be supplied; the rest fall back to their defaults.
| Parameter | Type | Required | Default | Details |
|---|---|---|---|---|
modelClaude model to use | string | yes | — | claude-opus-4-8claude-sonnet-4-5claude-sonnet-4-6claude-sonnet-5claude-3-7-sonnetclaude-3-5-sonnetclaude-3-5-haiku-latestclaude-haiku-4-5claude-sonnet-4-0claude-opus-4-0claude-opus-4-5claude-fable-5 |
messagesConversation messages | ClaudeMessageParam[] | yes | — | — |
└ roleMessage role | string | yes | — | e.g. user |
└ contentMessage content: a string or an array of content blocks. Passed through to the provider as-is. | ClaudeContentBlock[] | yes | — | — |
└ typeContent block type | string | yes | — | texttool_usetool_resultimagethinkingfiledocument |
└ textText content | string | no | — | — |
└ cache_controlCache control | object | no | — | — |
└ idUnique ID for the tool call | string | no | — | — |
└ nameTool name | string | no | — | — |
└ inputJSON input for the tool | string | number | integer | boolean | array | object | no | — | — |
└ tool_use_idThe corresponding tool_use id | string | no | — | — |
└ contentTool result content | ClaudeToolResultContentText[] | no | — | — |
└ thinkingInternal thinking text | string | no | — | — |
└ signatureSignature is required when echoing thinking back | string | no | — | — |
└ sourceContent source | object | no | — | — |
max_tokensMaximum number of tokens to generate | number | no | — | e.g. 1024 |
temperatureSampling temperature, between 0 and 2 | number | no | 1 | 0–2 |
systemSystem prompt as a string or array of syste blocks | string | number | integer | boolean | array | object | no | — | — |
toolsList of tools available to the model. Passed through to the provider as-is. | ClaudeToolSchema[] | no | — | — |
└ nameTool name | string | yes | — | — |
└ descriptionShort description of the tool | string | no | — | — |
└ input_schemaJSON Schema for the tool input | string | number | integer | boolean | array | object | yes | — | — |
└ type | string | yes | custom | — |
tool_choiceControls which (if any) tool is called by the model. "auto" lets the model decide; "any" forces a tool call; { type: "tool", name } forces a specific tool. | ClaudeToolChoiceToolParam | string | no | — | — |
service_tierSpecifies the processing type used for serving the request. Passed through to the provider as-is. | string | no | — | autoflexprioritydefault |
context_managementContext management options. Passed through to the provider as-is. | object | no | — | — |
└ editsList of context management edits to apply | ContextManagementEdit[] | yes | — | — |
└ typeclear_thinking_20251015 or clear_tool_uses_20250919 | string | yes | clear_tool_uses_20250919 | — |
└ triggerWhen to trigger this edit | object | no | — | — |
└ keepWhat to keep when applying the edit: a criterion object or a keyword such as "all". | ContextCriterion | string | no | — | — |
└ clear_at_leastMinimum to clear when applying the edit | object | no | — | — |
└ exclude_toolsExclude these tool names from clearing | string[] | no | — | — |
└ clear_tool_inputsWhether to clear the tool uses | boolean | no | false | — |
options | object | no | — | — |
└ safety_checksSafety check settings | object | no | — | — |
└ enabledWhether to run content moderation. Defaults to true. | boolean | no | — | — |
└ driveSave result to Picsart Drive | object | no | — | — |
└ nameFile name in Picsart Drive | string | yes | — | — |
└ attributesCustom attributes to attach to the file | object | no | — | — |
└ folderTarget folder in Picsart Drive | object | no | — | — |
Response
Over HTTP the output arrives inside a status envelope, at response.result. ai.apis.run() unwraps that envelope for you and resolves to { result, usage } instead. Either way the resultitself is the vendor's own shape.
{
"result": {},
"usage": {
"credits": 0
}
}