first commit
This commit is contained in:
139
docs/openapi/paths/integrations/openai/responses.yaml
Normal file
139
docs/openapi/paths/integrations/openai/responses.yaml
Normal file
@@ -0,0 +1,139 @@
|
||||
# OpenAI Integration - Responses API Endpoints
|
||||
|
||||
responses:
|
||||
post:
|
||||
operationId: openaiCreateResponse
|
||||
summary: Create response (OpenAI Responses API)
|
||||
description: |
|
||||
Creates a response using OpenAI Responses 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 `status` will not be `completed`. When completed, the full response with `output_text` will be returned. See [Async Inference](/features/async-inference) for details.
|
||||
|
||||
**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/responses`).
|
||||
tags:
|
||||
- OpenAI 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/openai/responses.yaml#/OpenAIResponsesRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: Successful response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../../../schemas/integrations/openai/responses.yaml#/OpenAIResponsesResponse'
|
||||
text/event-stream:
|
||||
schema:
|
||||
$ref: '../../../schemas/integrations/openai/responses.yaml#/OpenAIResponsesStreamResponse'
|
||||
'400':
|
||||
$ref: '../../../openapi.yaml#/components/responses/BadRequest'
|
||||
'500':
|
||||
$ref: '../../../openapi.yaml#/components/responses/InternalError'
|
||||
|
||||
security:
|
||||
- BearerAuth: []
|
||||
- BasicAuth: []
|
||||
- VirtualKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
azure-responses:
|
||||
post:
|
||||
operationId: azureCreateResponse
|
||||
summary: Create response (Azure OpenAI)
|
||||
tags:
|
||||
- OpenAI Integration
|
||||
- Azure Integration
|
||||
parameters:
|
||||
- name: deployment-id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Azure deployment ID
|
||||
- name: api-version
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../../../schemas/integrations/openai/responses.yaml#/OpenAIResponsesRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: Successful response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../../../schemas/integrations/openai/responses.yaml#/OpenAIResponsesResponse'
|
||||
text/event-stream:
|
||||
schema:
|
||||
$ref: '../../../schemas/integrations/openai/responses.yaml#/OpenAIResponsesStreamResponse'
|
||||
'400':
|
||||
$ref: '../../../openapi.yaml#/components/responses/BadRequest'
|
||||
'500':
|
||||
$ref: '../../../openapi.yaml#/components/responses/InternalError'
|
||||
|
||||
# Input tokens endpoint (count tokens for Responses API format)
|
||||
security:
|
||||
- BearerAuth: []
|
||||
- BasicAuth: []
|
||||
- VirtualKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
responses-input-tokens:
|
||||
post:
|
||||
operationId: openaiCountInputTokens
|
||||
summary: Count input tokens
|
||||
description: |
|
||||
Counts the number of tokens in a Responses API request.
|
||||
tags:
|
||||
- OpenAI Integration
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../../../schemas/integrations/openai/responses.yaml#/OpenAIResponsesRequest'
|
||||
responses:
|
||||
'200':
|
||||
description: Successful response
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../../../schemas/inference/count-tokens.yaml#/CountTokensResponse'
|
||||
'400':
|
||||
$ref: '../../../openapi.yaml#/components/responses/BadRequest'
|
||||
'500':
|
||||
$ref: '../../../openapi.yaml#/components/responses/InternalError'
|
||||
security:
|
||||
- BearerAuth: []
|
||||
- BasicAuth: []
|
||||
- VirtualKeyAuth: []
|
||||
- ApiKeyAuth: []
|
||||
Reference in New Issue
Block a user