---
title: "Cygnal Anthropic Messages"
method: POST
path: "/cygnal/v1/messages"
---

# Cygnal Anthropic Messages

`POST /cygnal/v1/messages`

## Request

- Base URL: `https://api.grayswan.ai`
- URL: `https://api.grayswan.ai/cygnal/v1/messages`
- Auth: none declared
- TypeScript: <https://skmtc.dev/grayswan/apis/gray-swan-ai-api/docs/cygnal/v1/messages/post.ts> (a function with typed inputs; its response is checked against the schema)

Create Anthropic-compatible messages with Cygnal protection.

Docs: [Guide](https://docs.grayswan.ai/cygnal/creating-completions) |
[API Reference](https://docs.grayswan.ai/api-reference/cygnal/anthropic-messages-v1)

## Response `200`

Successful Response

- ApiTypesResponsesAnthropicResponseCreateChatCompletionResponse: Anthropic message response
  - `id` string, required
  - `type` 'message', required
  - `role` 'assistant', required
  - `content` union[], required
    - union
      - ContentBlockOutput: Base content block for Anthropic responses
        - `type` 'text', required
        - `text` string, required
      - ToolUseBlock: Tool use block for Anthropic responses
        - `type` 'tool_use', required
        - `id` string, required
        - `name` string, required
        - `input` object, required
  - `model` string, required
  - `stop_reason` 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | 'content_filter', nullable
  - `usage` AnthropicUsage: Usage information for Anthropic API
    - `input_tokens` integer, required
    - `output_tokens` integer, required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `422`: Unprocessable Content
- `500`: Internal Server Error

---

[API](https://skmtc.dev/grayswan/apis/gray-swan-ai-api.md) - [All operations](https://skmtc.dev/grayswan/apis/gray-swan-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grayswan/apis/gray-swan-ai-api/revisions/ed4b27064dfa?raw)
