120 lines
4.0 KiB
YAML
120 lines
4.0 KiB
YAML
# Anthropic Integration - Messages API Endpoints
|
|
|
|
messages:
|
|
post:
|
|
operationId: anthropicCreateMessage
|
|
summary: Create message (Anthropic format)
|
|
description: |
|
|
Creates a message using Anthropic Messages API format.
|
|
Supports streaming via SSE.
|
|
|
|
**Async inference:** Send `x-bf-async: true` to submit the request as a background job and receive a job ID immediately. Poll with `x-bf-async-id: <job-id>` to retrieve the result. When the job is still processing, the response will have an empty `content` array. When completed, `content` will contain the full result. See [Async Inference](/features/async-inference) for details.
|
|
tags:
|
|
- Anthropic Integration
|
|
parameters:
|
|
- name: x-bf-async
|
|
in: header
|
|
required: false
|
|
schema:
|
|
type: string
|
|
enum: ["true"]
|
|
description: Set to `true` to submit this request as an async job. Returns immediately with a job ID. Not
|
|
compatible with streaming.
|
|
- name: x-bf-async-id
|
|
in: header
|
|
required: false
|
|
schema:
|
|
type: string
|
|
description: Poll for results of a previously submitted async job by providing the job ID returned from the
|
|
initial async request.
|
|
- name: x-bf-async-job-result-ttl
|
|
in: header
|
|
required: false
|
|
schema:
|
|
type: integer
|
|
default: 3600
|
|
description: Override the default result TTL in seconds. Results expire after this duration from completion time.
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../../../schemas/integrations/anthropic/messages.yaml#/AnthropicMessageRequest'
|
|
responses:
|
|
'200':
|
|
description: Successful response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../../../schemas/integrations/anthropic/messages.yaml#/AnthropicMessageResponse'
|
|
text/event-stream:
|
|
schema:
|
|
$ref: '../../../schemas/integrations/anthropic/messages.yaml#/AnthropicStreamEvent'
|
|
'400':
|
|
description: Bad request
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../../../schemas/integrations/anthropic/common.yaml#/AnthropicError'
|
|
'500':
|
|
description: Internal server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../../../schemas/integrations/anthropic/common.yaml#/AnthropicError'
|
|
|
|
# Wildcard path for extended messages endpoints (e.g., /v1/messages/batches)
|
|
security:
|
|
- BearerAuth: []
|
|
- BasicAuth: []
|
|
- VirtualKeyAuth: []
|
|
- ApiKeyAuth: []
|
|
messages-wildcard:
|
|
post:
|
|
operationId: anthropicCreateMessageWildcard
|
|
summary: Create message (Anthropic format) - wildcard
|
|
description: |
|
|
Handles extended messages API paths.
|
|
tags:
|
|
- Anthropic Integration
|
|
parameters:
|
|
- name: path
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Extended path
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../../../schemas/integrations/anthropic/messages.yaml#/AnthropicMessageRequest'
|
|
responses:
|
|
'200':
|
|
description: Successful response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../../../schemas/integrations/anthropic/messages.yaml#/AnthropicMessageResponse'
|
|
text/event-stream:
|
|
schema:
|
|
$ref: '../../../schemas/integrations/anthropic/messages.yaml#/AnthropicStreamEvent'
|
|
'400':
|
|
description: Bad request
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../../../schemas/integrations/anthropic/common.yaml#/AnthropicError'
|
|
'500':
|
|
description: Internal server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../../../schemas/integrations/anthropic/common.yaml#/AnthropicError'
|
|
security:
|
|
- BearerAuth: []
|
|
- BasicAuth: []
|
|
- VirtualKeyAuth: []
|
|
- ApiKeyAuth: []
|