Anthropic and Responses APIs

Anthropic and Responses APIs

Both formats reach the same models, with the same prices and limits as /chat/completions.

What is supported

FormatEndpointNotes
Anthropic MessagesPOST /v1/messagesText, images, tools, and streaming. Set thinking to receive thinking blocks. Server tools, PDF documents, and token counting are not supported.
OpenAI ResponsesPOST /responsesNothing is stored: send the whole conversation in input with store set to false. previous_response_id and hosted tools are not supported.

Examples

import os
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.silkcompute.com",
    api_key=os.environ["SILK_API_KEY"],
)

message = client.messages.create(
    model="deepseek-v4.1-flash-1017-uncensored",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Explain why the sky is blue."}],
)

print(message.content[0].text)

Errors

/v1/messages returns errors in the Anthropic shape, {"type": "error", "error": {"type", "message"}}, with the same status codes as the other endpoints.