openapi: 3.1.0 info: title: Fast ACCOUNT_COSTS Chat API version: 0.1.0 tags: - name: Chat paths: /agents/v1/chat/completions: post: tags: - Chat summary: Create Chat Completion description: 'Create a chat completion (OpenAI-compatible). Uses litellm with provider fallback: Azure GPT-5.5 → Anthropic Sonnet 4.6. The model in the request is ignored — provider selection is automatic.' operationId: create_chat_completion_agents_v1_chat_completions_post security: - HTTPBearer: [] - HTTPBearer: [] parameters: - name: x-session-id in: header required: false schema: anyOf: - type: string maxLength: 255 - type: 'null' description: Optional opaque conversation identifier. When provided, the call's Langfuse trace is grouped under this session_id, letting a multi-turn agentic conversation appear as one timeline. Clients should pass the same value across every turn of a single conversation. title: X-Session-Id description: Optional opaque conversation identifier. When provided, the call's Langfuse trace is grouped under this session_id, letting a multi-turn agentic conversation appear as one timeline. Clients should pass the same value across every turn of a single conversation. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ChatRequest' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: ResponseFunction: properties: name: anyOf: - type: string - type: 'null' title: Name arguments: type: string title: Arguments type: object required: - arguments title: ResponseFunction Function: properties: name: type: string title: Name description: anyOf: - type: string - type: 'null' title: Description parameters: title: Parameters type: object required: - name - parameters title: Function SystemMessage: properties: name: anyOf: - type: string - type: 'null' title: Name role: type: string const: system title: Role default: system content: anyOf: - type: string - items: $ref: '#/components/schemas/TextContent' type: array title: Content type: object required: - content title: SystemMessage StreamOptions: properties: include_usage: type: boolean title: Include Usage default: true type: object title: StreamOptions ToolCall: properties: index: anyOf: - type: integer - type: 'null' title: Index id: anyOf: - type: string - type: 'null' title: Id type: type: string const: function title: Type default: function function: $ref: '#/components/schemas/ResponseFunction' type: object required: - function title: ToolCall UserMessage: properties: name: anyOf: - type: string - type: 'null' title: Name role: type: string const: user title: Role default: user content: anyOf: - type: string - items: anyOf: - $ref: '#/components/schemas/TextContent' - $ref: '#/components/schemas/ImageContent' type: array title: Content type: object required: - content title: UserMessage HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError ImageContent: properties: type: type: string const: image_url title: Type default: image image_url: $ref: '#/components/schemas/ImageUrl' cache_control: anyOf: - additionalProperties: true type: object - type: 'null' title: Cache Control type: object required: - image_url title: ImageContent Tool: properties: type: type: string const: function title: Type default: function function: $ref: '#/components/schemas/Function' type: object required: - function title: Tool ImageUrl: properties: url: type: string title: Url detail: anyOf: - type: string - type: 'null' title: Detail default: auto type: object required: - url title: ImageUrl ToolMessage: properties: role: type: string const: tool title: Role default: tool content: anyOf: - type: string - items: $ref: '#/components/schemas/ToolContent' type: array - items: additionalProperties: true type: object type: array title: Content tool_call_id: type: string title: Tool Call Id type: object required: - content - tool_call_id title: ToolMessage ToolContent: properties: type: type: string const: text title: Type default: text text: type: string title: Text type: object required: - text title: ToolContent ChatRequest: properties: messages: items: anyOf: - $ref: '#/components/schemas/SystemMessage' - $ref: '#/components/schemas/UserMessage' - $ref: '#/components/schemas/AssistantMessage' - $ref: '#/components/schemas/ToolMessage' type: array title: Messages model: type: string title: Model default: custom frequency_penalty: anyOf: - type: number maximum: 2.0 minimum: -2.0 - type: 'null' title: Frequency Penalty default: 0.0 presence_penalty: anyOf: - type: number maximum: 2.0 minimum: -2.0 - type: 'null' title: Presence Penalty default: 0.0 stream: anyOf: - type: boolean - type: 'null' title: Stream default: false stream_options: anyOf: - $ref: '#/components/schemas/StreamOptions' - type: 'null' temperature: anyOf: - type: number maximum: 2.0 minimum: 0.0 - type: 'null' title: Temperature default: 1.0 top_p: anyOf: - type: number maximum: 1.0 minimum: 0.0 - type: 'null' title: Top P default: 1.0 user: anyOf: - type: string - type: 'null' title: User max_tokens: anyOf: - type: integer - type: 'null' title: Max Tokens default: 2048 max_completion_tokens: anyOf: - type: integer - type: 'null' title: Max Completion Tokens reasoning_effort: anyOf: - type: string enum: - low - medium - high - type: 'null' title: Reasoning Effort n: anyOf: - type: integer - type: 'null' title: N default: 1 tools: anyOf: - items: $ref: '#/components/schemas/Tool' type: array - type: 'null' title: Tools tool_choice: anyOf: - type: string - {} title: Tool Choice default: auto stop: anyOf: - items: type: string type: array - type: string - type: 'null' title: Stop extra_body: anyOf: - additionalProperties: true type: object - type: 'null' title: Extra Body type: object required: - messages title: ChatRequest AssistantMessage: properties: name: anyOf: - type: string - type: 'null' title: Name role: type: string const: assistant title: Role default: assistant content: anyOf: - type: string - items: anyOf: - $ref: '#/components/schemas/TextContent' - $ref: '#/components/schemas/ImageContent' type: array - type: 'null' title: Content tool_calls: anyOf: - items: $ref: '#/components/schemas/ToolCall' type: array - type: 'null' title: Tool Calls type: object title: AssistantMessage TextContent: properties: type: type: string const: text title: Type default: text text: type: string title: Text cache_control: anyOf: - additionalProperties: true type: object - type: 'null' title: Cache Control type: object required: - text title: TextContent securitySchemes: HTTPBearer: type: http scheme: bearer