> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neosantara.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a message

> Create a message using the Anthropic-compatible API. Supports tool use and sseStreaming.



## OpenAPI

````yaml /api-reference/openapi.json post /anthropic/v1/messages
openapi: 3.1.0
info:
  title: Neosantara AI API
  description: OpenAI-compatible LLM Gateway
  version: 1.0.0
servers:
  - url: https://api.neosantara.xyz
    description: Neosantara Production Gateway
security:
  - bearerAuth: []
paths:
  /anthropic/v1/messages:
    post:
      tags:
        - Anthropic
      summary: Create a message
      description: >-
        Create a message using the Anthropic-compatible API. Supports tool use
        and sseStreaming.
      operationId: postAnthropicV1Messages
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        enum:
                          - user
                          - assistant
                          - system
                      content:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              oneOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: text
                                    text:
                                      type: string
                                    citations:
                                      type: array
                                      items:
                                        oneOf:
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                const: web_search_result_location
                                              cited_text:
                                                type: string
                                              url:
                                                type: string
                                              title:
                                                type: string
                                              encrypted_index:
                                                type: string
                                            required:
                                              - type
                                              - cited_text
                                              - url
                                              - title
                                              - encrypted_index
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                const: page_location
                                              cited_text:
                                                type: string
                                              document_index:
                                                type: number
                                              document_title:
                                                type:
                                                  - string
                                                  - 'null'
                                              start_page_number:
                                                type: number
                                              end_page_number:
                                                type: number
                                            required:
                                              - type
                                              - cited_text
                                              - document_index
                                              - document_title
                                              - start_page_number
                                              - end_page_number
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                const: char_location
                                              cited_text:
                                                type: string
                                              document_index:
                                                type: number
                                              document_title:
                                                type:
                                                  - string
                                                  - 'null'
                                              start_char_index:
                                                type: number
                                              end_char_index:
                                                type: number
                                            required:
                                              - type
                                              - cited_text
                                              - document_index
                                              - document_title
                                              - start_char_index
                                              - end_char_index
                                  required:
                                    - type
                                    - text
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: image
                                    source:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          const: base64
                                        media_type:
                                          type: string
                                        data:
                                          type: string
                                      required:
                                        - type
                                        - media_type
                                        - data
                                  required:
                                    - type
                                    - source
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: document
                                    source:
                                      type: object
                                      properties:
                                        type:
                                          anyOf:
                                            - type: string
                                              const: base64
                                            - type: string
                                              const: url
                                        media_type:
                                          type: string
                                        data:
                                          type: string
                                        url:
                                          type: string
                                      required:
                                        - type
                                        - media_type
                                    title:
                                      type: string
                                    context:
                                      type: string
                                    citations:
                                      type: object
                                      properties:
                                        enabled:
                                          type: boolean
                                      required:
                                        - enabled
                                  required:
                                    - type
                                    - source
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: tool_use
                                    id:
                                      type: string
                                    name:
                                      type: string
                                    input: {}
                                    caller:
                                      anyOf:
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: code_execution_20250825
                                            tool_id:
                                              type: string
                                          required:
                                            - type
                                            - tool_id
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: direct
                                          required:
                                            - type
                                  required:
                                    - type
                                    - id
                                    - name
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: server_tool_use
                                    id:
                                      type: string
                                    name:
                                      type: string
                                    input:
                                      type:
                                        - object
                                        - 'null'
                                      additionalProperties: {}
                                  required:
                                    - type
                                    - id
                                    - name
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: tool_result
                                    tool_use_id:
                                      type: string
                                    content:
                                      anyOf:
                                        - type: string
                                        - type: array
                                          items: {}
                                    is_error:
                                      type: boolean
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: thinking
                                    thinking:
                                      type: string
                                    signature:
                                      type: string
                                  required:
                                    - type
                                    - thinking
                                    - signature
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: redacted_thinking
                                    data:
                                      type: string
                                  required:
                                    - type
                                    - data
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: compaction
                                    content:
                                      type: string
                                  required:
                                    - type
                                    - content
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: mcp_tool_use
                                    id:
                                      type: string
                                    name:
                                      type: string
                                    input: {}
                                    server_name:
                                      type: string
                                  required:
                                    - type
                                    - id
                                    - name
                                    - server_name
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: mcp_tool_result
                                    tool_use_id:
                                      type: string
                                    is_error:
                                      type: boolean
                                    content:
                                      type: array
                                      items:
                                        anyOf:
                                          - type: string
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                const: text
                                              text:
                                                type: string
                                            required:
                                              - type
                                              - text
                                  required:
                                    - type
                                    - tool_use_id
                                    - is_error
                                    - content
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: code_execution_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: bash_code_execution_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: text_editor_code_execution_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: tool_search_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: web_fetch_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: web_search_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                    required:
                      - role
                      - content
                  minItems: 1
                max_tokens:
                  type: integer
                  exclusiveMinimum: 0
                system:
                  anyOf:
                    - type: string
                    - type: array
                      items: {}
                temperature:
                  type: number
                  minimum: 0
                  maximum: 1
                top_p:
                  type: number
                  minimum: 0
                  maximum: 1
                top_k:
                  type: integer
                  exclusiveMinimum: 0
                stream:
                  type: boolean
                  default: false
                stop_sequences:
                  type: array
                  items:
                    type: string
                metadata:
                  type: object
                  additionalProperties: {}
                tools:
                  type: array
                  items: {}
                tool_choice: {}
                mcp_servers:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        const: url
                      url:
                        type: string
                        format: uri
                      name:
                        type: string
                        minLength: 1
                      authorization_token:
                        type: string
                      allowed_tools:
                        type: array
                        items:
                          type: string
                    required:
                      - url
                      - name
                    additionalProperties: true
                thinking:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - enabled
                        - disabled
                        - adaptive
                    budget_tokens:
                      type: integer
                      minimum: 1024
                  required:
                    - type
                effort:
                  type: string
                  enum:
                    - low
                    - medium
                    - high
                    - max
                speed:
                  type: string
                  enum:
                    - fast
                    - standard
                context_management:
                  type: object
                  properties:
                    edits:
                      type: array
                      items: {}
                  required:
                    - edits
                output_config:
                  type: object
                  properties:
                    effort:
                      type: string
                      enum:
                        - low
                        - medium
                        - high
                        - max
                    format: {}
                    budget_tokens:
                      type: integer
                      exclusiveMinimum: 0
                  additionalProperties: true
              required:
                - model
                - messages
                - max_tokens
      responses:
        '200':
          description: Successful response or SSE stream
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type:
                      - string
                      - 'null'
                  type:
                    type: string
                    const: message
                  role:
                    type:
                      - string
                      - 'null'
                    enum:
                      - assistant
                      - null
                  content:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              const: text
                            text:
                              type: string
                            citations:
                              type: array
                              items:
                                oneOf:
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        const: web_search_result_location
                                      cited_text:
                                        type: string
                                      url:
                                        type: string
                                      title:
                                        type: string
                                      encrypted_index:
                                        type: string
                                    required:
                                      - type
                                      - cited_text
                                      - url
                                      - title
                                      - encrypted_index
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        const: page_location
                                      cited_text:
                                        type: string
                                      document_index:
                                        type: number
                                      document_title:
                                        type:
                                          - string
                                          - 'null'
                                      start_page_number:
                                        type: number
                                      end_page_number:
                                        type: number
                                    required:
                                      - type
                                      - cited_text
                                      - document_index
                                      - document_title
                                      - start_page_number
                                      - end_page_number
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        const: char_location
                                      cited_text:
                                        type: string
                                      document_index:
                                        type: number
                                      document_title:
                                        type:
                                          - string
                                          - 'null'
                                      start_char_index:
                                        type: number
                                      end_char_index:
                                        type: number
                                    required:
                                      - type
                                      - cited_text
                                      - document_index
                                      - document_title
                                      - start_char_index
                                      - end_char_index
                          required:
                            - type
                            - text
                        - type: object
                          properties:
                            type:
                              type: string
                              const: image
                            source:
                              type: object
                              properties:
                                type:
                                  type: string
                                  const: base64
                                media_type:
                                  type: string
                                data:
                                  type: string
                              required:
                                - type
                                - media_type
                                - data
                          required:
                            - type
                            - source
                        - type: object
                          properties:
                            type:
                              type: string
                              const: document
                            source:
                              type: object
                              properties:
                                type:
                                  anyOf:
                                    - type: string
                                      const: base64
                                    - type: string
                                      const: url
                                media_type:
                                  type: string
                                data:
                                  type: string
                                url:
                                  type: string
                              required:
                                - type
                                - media_type
                            title:
                              type: string
                            context:
                              type: string
                            citations:
                              type: object
                              properties:
                                enabled:
                                  type: boolean
                              required:
                                - enabled
                          required:
                            - type
                            - source
                        - type: object
                          properties:
                            type:
                              type: string
                              const: tool_use
                            id:
                              type: string
                            name:
                              type: string
                            input: {}
                            caller:
                              anyOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: code_execution_20250825
                                    tool_id:
                                      type: string
                                  required:
                                    - type
                                    - tool_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: direct
                                  required:
                                    - type
                          required:
                            - type
                            - id
                            - name
                        - type: object
                          properties:
                            type:
                              type: string
                              const: server_tool_use
                            id:
                              type: string
                            name:
                              type: string
                            input:
                              type:
                                - object
                                - 'null'
                              additionalProperties: {}
                          required:
                            - type
                            - id
                            - name
                        - type: object
                          properties:
                            type:
                              type: string
                              const: tool_result
                            tool_use_id:
                              type: string
                            content:
                              anyOf:
                                - type: string
                                - type: array
                                  items: {}
                            is_error:
                              type: boolean
                          required:
                            - type
                            - tool_use_id
                        - type: object
                          properties:
                            type:
                              type: string
                              const: thinking
                            thinking:
                              type: string
                            signature:
                              type: string
                          required:
                            - type
                            - thinking
                            - signature
                        - type: object
                          properties:
                            type:
                              type: string
                              const: redacted_thinking
                            data:
                              type: string
                          required:
                            - type
                            - data
                        - type: object
                          properties:
                            type:
                              type: string
                              const: compaction
                            content:
                              type: string
                          required:
                            - type
                            - content
                        - type: object
                          properties:
                            type:
                              type: string
                              const: mcp_tool_use
                            id:
                              type: string
                            name:
                              type: string
                            input: {}
                            server_name:
                              type: string
                          required:
                            - type
                            - id
                            - name
                            - server_name
                        - type: object
                          properties:
                            type:
                              type: string
                              const: mcp_tool_result
                            tool_use_id:
                              type: string
                            is_error:
                              type: boolean
                            content:
                              type: array
                              items:
                                anyOf:
                                  - type: string
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        const: text
                                      text:
                                        type: string
                                    required:
                                      - type
                                      - text
                          required:
                            - type
                            - tool_use_id
                            - is_error
                            - content
                        - type: object
                          properties:
                            type:
                              type: string
                              const: code_execution_tool_result
                            tool_use_id:
                              type: string
                            content: {}
                          required:
                            - type
                            - tool_use_id
                        - type: object
                          properties:
                            type:
                              type: string
                              const: bash_code_execution_tool_result
                            tool_use_id:
                              type: string
                            content: {}
                          required:
                            - type
                            - tool_use_id
                        - type: object
                          properties:
                            type:
                              type: string
                              const: text_editor_code_execution_tool_result
                            tool_use_id:
                              type: string
                            content: {}
                          required:
                            - type
                            - tool_use_id
                        - type: object
                          properties:
                            type:
                              type: string
                              const: tool_search_tool_result
                            tool_use_id:
                              type: string
                            content: {}
                          required:
                            - type
                            - tool_use_id
                        - type: object
                          properties:
                            type:
                              type: string
                              const: web_fetch_tool_result
                            tool_use_id:
                              type: string
                            content: {}
                          required:
                            - type
                            - tool_use_id
                        - type: object
                          properties:
                            type:
                              type: string
                              const: web_search_tool_result
                            tool_use_id:
                              type: string
                            content: {}
                          required:
                            - type
                            - tool_use_id
                  model:
                    type:
                      - string
                      - 'null'
                  stop_reason:
                    type:
                      - string
                      - 'null'
                  stop_sequence:
                    type:
                      - string
                      - 'null'
                  usage:
                    type: object
                    properties:
                      input_tokens:
                        type: number
                      output_tokens:
                        type: number
                      total_tokens:
                        type: number
                      cache_creation_input_tokens:
                        type:
                          - number
                          - 'null'
                      cache_read_input_tokens:
                        type:
                          - number
                          - 'null'
                      iterations:
                        type:
                          - array
                          - 'null'
                        items:
                          type: object
                          properties:
                            type:
                              anyOf:
                                - type: string
                                  const: compaction
                                - type: string
                                  const: message
                            input_tokens:
                              type: number
                            output_tokens:
                              type: number
                          required:
                            - type
                            - input_tokens
                            - output_tokens
                    required:
                      - input_tokens
                      - output_tokens
                    additionalProperties: true
                  container:
                    type:
                      - object
                      - 'null'
                    properties:
                      expires_at:
                        type: string
                      id:
                        type: string
                      skills:
                        type:
                          - array
                          - 'null'
                        items:
                          type: object
                          properties:
                            type:
                              anyOf:
                                - type: string
                                  const: anthropic
                                - type: string
                                  const: custom
                            skill_id:
                              type: string
                            version:
                              type: string
                          required:
                            - type
                            - skill_id
                            - version
                    required:
                      - expires_at
                      - id
                  context_management:
                    type:
                      - object
                      - 'null'
                    properties:
                      applied_edits:
                        type: array
                        items: {}
                    required:
                      - applied_edits
                required:
                  - type
                  - content
                  - usage
                additionalProperties: true
            text/event-stream:
              schema:
                oneOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        const: message_start
                      message:
                        type: object
                        properties:
                          id:
                            type:
                              - string
                              - 'null'
                          type:
                            type: string
                            const: message
                          role:
                            type: string
                            const: assistant
                          content:
                            type: array
                            items:
                              oneOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: text
                                    text:
                                      type: string
                                    citations:
                                      type: array
                                      items:
                                        oneOf:
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                const: web_search_result_location
                                              cited_text:
                                                type: string
                                              url:
                                                type: string
                                              title:
                                                type: string
                                              encrypted_index:
                                                type: string
                                            required:
                                              - type
                                              - cited_text
                                              - url
                                              - title
                                              - encrypted_index
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                const: page_location
                                              cited_text:
                                                type: string
                                              document_index:
                                                type: number
                                              document_title:
                                                type:
                                                  - string
                                                  - 'null'
                                              start_page_number:
                                                type: number
                                              end_page_number:
                                                type: number
                                            required:
                                              - type
                                              - cited_text
                                              - document_index
                                              - document_title
                                              - start_page_number
                                              - end_page_number
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                const: char_location
                                              cited_text:
                                                type: string
                                              document_index:
                                                type: number
                                              document_title:
                                                type:
                                                  - string
                                                  - 'null'
                                              start_char_index:
                                                type: number
                                              end_char_index:
                                                type: number
                                            required:
                                              - type
                                              - cited_text
                                              - document_index
                                              - document_title
                                              - start_char_index
                                              - end_char_index
                                  required:
                                    - type
                                    - text
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: image
                                    source:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          const: base64
                                        media_type:
                                          type: string
                                        data:
                                          type: string
                                      required:
                                        - type
                                        - media_type
                                        - data
                                  required:
                                    - type
                                    - source
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: document
                                    source:
                                      type: object
                                      properties:
                                        type:
                                          anyOf:
                                            - type: string
                                              const: base64
                                            - type: string
                                              const: url
                                        media_type:
                                          type: string
                                        data:
                                          type: string
                                        url:
                                          type: string
                                      required:
                                        - type
                                        - media_type
                                    title:
                                      type: string
                                    context:
                                      type: string
                                    citations:
                                      type: object
                                      properties:
                                        enabled:
                                          type: boolean
                                      required:
                                        - enabled
                                  required:
                                    - type
                                    - source
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: tool_use
                                    id:
                                      type: string
                                    name:
                                      type: string
                                    input: {}
                                    caller:
                                      anyOf:
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: code_execution_20250825
                                            tool_id:
                                              type: string
                                          required:
                                            - type
                                            - tool_id
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              const: direct
                                          required:
                                            - type
                                  required:
                                    - type
                                    - id
                                    - name
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: server_tool_use
                                    id:
                                      type: string
                                    name:
                                      type: string
                                    input:
                                      type:
                                        - object
                                        - 'null'
                                      additionalProperties: {}
                                  required:
                                    - type
                                    - id
                                    - name
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: tool_result
                                    tool_use_id:
                                      type: string
                                    content:
                                      anyOf:
                                        - type: string
                                        - type: array
                                          items: {}
                                    is_error:
                                      type: boolean
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: thinking
                                    thinking:
                                      type: string
                                    signature:
                                      type: string
                                  required:
                                    - type
                                    - thinking
                                    - signature
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: redacted_thinking
                                    data:
                                      type: string
                                  required:
                                    - type
                                    - data
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: compaction
                                    content:
                                      type: string
                                  required:
                                    - type
                                    - content
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: mcp_tool_use
                                    id:
                                      type: string
                                    name:
                                      type: string
                                    input: {}
                                    server_name:
                                      type: string
                                  required:
                                    - type
                                    - id
                                    - name
                                    - server_name
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: mcp_tool_result
                                    tool_use_id:
                                      type: string
                                    is_error:
                                      type: boolean
                                    content:
                                      type: array
                                      items:
                                        anyOf:
                                          - type: string
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                const: text
                                              text:
                                                type: string
                                            required:
                                              - type
                                              - text
                                  required:
                                    - type
                                    - tool_use_id
                                    - is_error
                                    - content
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: code_execution_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: bash_code_execution_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: text_editor_code_execution_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: tool_search_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: web_fetch_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      const: web_search_tool_result
                                    tool_use_id:
                                      type: string
                                    content: {}
                                  required:
                                    - type
                                    - tool_use_id
                          model:
                            type:
                              - string
                              - 'null'
                          stop_reason:
                            type:
                              - string
                              - 'null'
                          stop_sequence:
                            type:
                              - string
                              - 'null'
                          usage:
                            type:
                              - object
                              - 'null'
                            properties:
                              input_tokens:
                                type: number
                              output_tokens:
                                type:
                                  - number
                                  - 'null'
                            required:
                              - input_tokens
                        required:
                          - type
                          - role
                          - content
                    required:
                      - type
                      - message
                  - type: object
                    properties:
                      type:
                        type: string
                        const: content_block_start
                      index:
                        type:
                          - number
                          - 'null'
                      content_block:
                        oneOf:
                          - type: object
                            properties:
                              type:
                                type: string
                                const: text
                              text:
                                type: string
                              citations:
                                type: array
                                items:
                                  oneOf:
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: web_search_result_location
                                        cited_text:
                                          type: string
                                        url:
                                          type: string
                                        title:
                                          type: string
                                        encrypted_index:
                                          type: string
                                      required:
                                        - type
                                        - cited_text
                                        - url
                                        - title
                                        - encrypted_index
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: page_location
                                        cited_text:
                                          type: string
                                        document_index:
                                          type: number
                                        document_title:
                                          type:
                                            - string
                                            - 'null'
                                        start_page_number:
                                          type: number
                                        end_page_number:
                                          type: number
                                      required:
                                        - type
                                        - cited_text
                                        - document_index
                                        - document_title
                                        - start_page_number
                                        - end_page_number
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: char_location
                                        cited_text:
                                          type: string
                                        document_index:
                                          type: number
                                        document_title:
                                          type:
                                            - string
                                            - 'null'
                                        start_char_index:
                                          type: number
                                        end_char_index:
                                          type: number
                                      required:
                                        - type
                                        - cited_text
                                        - document_index
                                        - document_title
                                        - start_char_index
                                        - end_char_index
                            required:
                              - type
                              - text
                          - type: object
                            properties:
                              type:
                                type: string
                                const: image
                              source:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    const: base64
                                  media_type:
                                    type: string
                                  data:
                                    type: string
                                required:
                                  - type
                                  - media_type
                                  - data
                            required:
                              - type
                              - source
                          - type: object
                            properties:
                              type:
                                type: string
                                const: document
                              source:
                                type: object
                                properties:
                                  type:
                                    anyOf:
                                      - type: string
                                        const: base64
                                      - type: string
                                        const: url
                                  media_type:
                                    type: string
                                  data:
                                    type: string
                                  url:
                                    type: string
                                required:
                                  - type
                                  - media_type
                              title:
                                type: string
                              context:
                                type: string
                              citations:
                                type: object
                                properties:
                                  enabled:
                                    type: boolean
                                required:
                                  - enabled
                            required:
                              - type
                              - source
                          - type: object
                            properties:
                              type:
                                type: string
                                const: tool_use
                              id:
                                type: string
                              name:
                                type: string
                              input: {}
                              caller:
                                anyOf:
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        const: code_execution_20250825
                                      tool_id:
                                        type: string
                                    required:
                                      - type
                                      - tool_id
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        const: direct
                                    required:
                                      - type
                            required:
                              - type
                              - id
                              - name
                          - type: object
                            properties:
                              type:
                                type: string
                                const: server_tool_use
                              id:
                                type: string
                              name:
                                type: string
                              input:
                                type:
                                  - object
                                  - 'null'
                                additionalProperties: {}
                            required:
                              - type
                              - id
                              - name
                          - type: object
                            properties:
                              type:
                                type: string
                                const: tool_result
                              tool_use_id:
                                type: string
                              content:
                                anyOf:
                                  - type: string
                                  - type: array
                                    items: {}
                              is_error:
                                type: boolean
                            required:
                              - type
                              - tool_use_id
                          - type: object
                            properties:
                              type:
                                type: string
                                const: thinking
                              thinking:
                                type: string
                              signature:
                                type: string
                            required:
                              - type
                              - thinking
                              - signature
                          - type: object
                            properties:
                              type:
                                type: string
                                const: redacted_thinking
                              data:
                                type: string
                            required:
                              - type
                              - data
                          - type: object
                            properties:
                              type:
                                type: string
                                const: compaction
                              content:
                                type: string
                            required:
                              - type
                              - content
                          - type: object
                            properties:
                              type:
                                type: string
                                const: mcp_tool_use
                              id:
                                type: string
                              name:
                                type: string
                              input: {}
                              server_name:
                                type: string
                            required:
                              - type
                              - id
                              - name
                              - server_name
                          - type: object
                            properties:
                              type:
                                type: string
                                const: mcp_tool_result
                              tool_use_id:
                                type: string
                              is_error:
                                type: boolean
                              content:
                                type: array
                                items:
                                  anyOf:
                                    - type: string
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          const: text
                                        text:
                                          type: string
                                      required:
                                        - type
                                        - text
                            required:
                              - type
                              - tool_use_id
                              - is_error
                              - content
                          - type: object
                            properties:
                              type:
                                type: string
                                const: code_execution_tool_result
                              tool_use_id:
                                type: string
                              content: {}
                            required:
                              - type
                              - tool_use_id
                          - type: object
                            properties:
                              type:
                                type: string
                                const: bash_code_execution_tool_result
                              tool_use_id:
                                type: string
                              content: {}
                            required:
                              - type
                              - tool_use_id
                          - type: object
                            properties:
                              type:
                                type: string
                                const: text_editor_code_execution_tool_result
                              tool_use_id:
                                type: string
                              content: {}
                            required:
                              - type
                              - tool_use_id
                          - type: object
                            properties:
                              type:
                                type: string
                                const: tool_search_tool_result
                              tool_use_id:
                                type: string
                              content: {}
                            required:
                              - type
                              - tool_use_id
                          - type: object
                            properties:
                              type:
                                type: string
                                const: web_fetch_tool_result
                              tool_use_id:
                                type: string
                              content: {}
                            required:
                              - type
                              - tool_use_id
                          - type: object
                            properties:
                              type:
                                type: string
                                const: web_search_tool_result
                              tool_use_id:
                                type: string
                              content: {}
                            required:
                              - type
                              - tool_use_id
                    required:
                      - type
                      - content_block
                  - type: object
                    properties:
                      type:
                        type: string
                        const: content_block_delta
                      index:
                        type:
                          - number
                          - 'null'
                      delta:
                        oneOf:
                          - type: object
                            properties:
                              type:
                                type: string
                                const: input_json_delta
                              partial_json:
                                type: string
                            required:
                              - type
                              - partial_json
                          - type: object
                            properties:
                              type:
                                type: string
                                const: text_delta
                              text:
                                type: string
                            required:
                              - type
                              - text
                          - type: object
                            properties:
                              type:
                                type: string
                                const: thinking_delta
                              thinking:
                                type: string
                            required:
                              - type
                              - thinking
                          - type: object
                            properties:
                              type:
                                type: string
                                const: redacted_thinking_delta
                              data:
                                type: string
                            required:
                              - type
                              - data
                    required:
                      - type
                      - delta
                  - type: object
                    properties:
                      type:
                        type: string
                        const: content_block_stop
                      index:
                        type:
                          - number
                          - 'null'
                    required:
                      - type
                  - type: object
                    properties:
                      type:
                        type: string
                        const: message_delta
                      delta:
                        type: object
                        properties:
                          stop_reason:
                            type:
                              - string
                              - 'null'
                          stop_sequence:
                            type:
                              - string
                              - 'null'
                      usage:
                        type:
                          - object
                          - 'null'
                        properties:
                          output_tokens:
                            type:
                              - number
                              - 'null'
                    required:
                      - type
                      - delta
                  - type: object
                    properties:
                      type:
                        type: string
                        const: message_stop
                    required:
                      - type
                  - type: object
                    properties:
                      type:
                        type: string
                        const: error
                      error:
                        type: object
                        properties:
                          type:
                            type: string
                          message:
                            type: string
                        required:
                          - type
                          - message
                    required:
                      - type
                      - error
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    const: error
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - invalid_request_error
                          - authentication_error
                          - permission_error
                          - not_found_error
                          - rate_limit_error
                          - api_error
                          - overloaded_error
                      message:
                        type: string
                      code:
                        type: string
                      param:
                        type:
                          - string
                          - 'null'
                    required:
                      - type
                      - message
                required:
                  - type
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    const: error
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - invalid_request_error
                          - authentication_error
                          - permission_error
                          - not_found_error
                          - rate_limit_error
                          - api_error
                          - overloaded_error
                      message:
                        type: string
                      code:
                        type: string
                      param:
                        type:
                          - string
                          - 'null'
                    required:
                      - type
                      - message
                required:
                  - type
                  - error
        '404':
          description: Model Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    const: error
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - invalid_request_error
                          - authentication_error
                          - permission_error
                          - not_found_error
                          - rate_limit_error
                          - api_error
                          - overloaded_error
                      message:
                        type: string
                      code:
                        type: string
                      param:
                        type:
                          - string
                          - 'null'
                    required:
                      - type
                      - message
                required:
                  - type
                  - error
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: python
          label: Python SDK
          source: |-
            import anthropic

            client = anthropic.Anthropic(
                api_key='YOUR_NEOSANTARA_API_KEY',
                base_url='https://api.neosantara.xyz/anthropic'
            )

            message = client.messages.create(
                model='archipelago-core-70b',
                max_tokens=1024,
                messages=[{'role': 'user', 'content': 'Halo, apa kabar?'}]
            )
            print(message.content[0].text)
        - lang: javascript
          label: Node.js SDK
          source: |-
            import Anthropic from '@anthropic-ai/sdk';

            const client = new Anthropic({
              apiKey: 'YOUR_NEOSANTARA_API_KEY',
              baseURL: 'https://api.neosantara.xyz/anthropic'
            });

            const message = await client.messages.create({
              model: 'archipelago-core-70b',
              max_tokens: 1024,
              messages: [{ role: 'user', content: 'Halo, apa kabar?' }],
            });
            console.log(message.content[0].text);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.