openapi: 3.2.0 info: title: RunInfra Chat API description: OpenAI-compatible HTTP API for verified RunInfra inference deployments. version: '2026-04-24' contact: name: RunInfra support email: jaber@runinfra.ai url: https://runinfra.ai/contact servers: - url: https://api.runinfra.ai/v1 description: Production security: - bearerAuth: [] tags: - name: Chat Completions paths: /chat/completions: post: operationId: createChatCompletion summary: Create chat completion description: OpenAI-compatible chat completion. Supports streaming, tools, and structured output. tags: - Chat Completions requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ChatCompletionRequest' responses: '200': description: Chat completion (or SSE stream if stream=true) content: application/json: schema: $ref: '#/components/schemas/ChatCompletion' text/event-stream: schema: $ref: '#/components/schemas/ChatCompletionChunk' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '402': $ref: '#/components/responses/PaymentRequired' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/UnprocessableEntity' '429': $ref: '#/components/responses/RateLimited' '500': $ref: '#/components/responses/InternalServerError' '502': $ref: '#/components/responses/BadGateway' '503': $ref: '#/components/responses/Unavailable' '504': $ref: '#/components/responses/GatewayTimeout' components: responses: RateLimited: description: Rate limit exceeded headers: Retry-After: schema: type: integer description: Seconds to wait before retrying X-RateLimit-Remaining: schema: type: integer description: Remaining requests in the window content: application/json: schema: $ref: '#/components/schemas/Error' Conflict: description: Idempotency conflict content: application/json: schema: $ref: '#/components/schemas/Error' InternalServerError: description: Unexpected gateway error content: application/json: schema: $ref: '#/components/schemas/Error' BadRequest: description: Malformed request content: application/json: schema: $ref: '#/components/schemas/Error' NotFound: description: Model or deployment not found content: application/json: schema: $ref: '#/components/schemas/Error' UnprocessableEntity: description: Request cannot be replayed or processed safely content: application/json: schema: $ref: '#/components/schemas/Error' BadGateway: description: Upstream serving backend transient failure content: application/json: schema: $ref: '#/components/schemas/Error' GatewayTimeout: description: Gateway timeout content: application/json: schema: $ref: '#/components/schemas/Error' Unavailable: description: Endpoint stopped, provisioning, or at capacity content: application/json: schema: $ref: '#/components/schemas/Error' Unauthorized: description: Missing or invalid API key content: application/json: schema: $ref: '#/components/schemas/Error' Forbidden: description: Key scope mismatch or plan limit exceeded content: application/json: schema: $ref: '#/components/schemas/Error' PaymentRequired: description: Insufficient credits content: application/json: schema: $ref: '#/components/schemas/Error' schemas: ChatCompletionRequest: type: object required: - model - messages properties: model: type: string description: Model id returned by GET /v1/models. Pipeline-scoped snippets may use `default` when generated by the dashboard. example: llama-3.3-70b messages: type: array items: $ref: '#/components/schemas/ChatMessage' stream: type: boolean default: false description: When true, the response is a server-sent event stream. temperature: type: number default: 1 minimum: 0 maximum: 2 max_tokens: type: integer minimum: 1 top_p: type: number default: 1 minimum: 0 maximum: 1 n: type: integer default: 1 stop: oneOf: - type: string - type: array items: type: string maxItems: 4 tools: type: array items: $ref: '#/components/schemas/Tool' tool_choice: oneOf: - type: string enum: - none - auto - required - type: object properties: type: type: string enum: - function function: type: object properties: name: type: string response_format: $ref: '#/components/schemas/ResponseFormat' Tool: type: object required: - type - function properties: type: type: string enum: - function function: type: object required: - name properties: name: type: string description: type: string parameters: type: object description: JSON Schema Error: type: object properties: error: type: object required: - message - type properties: message: type: string type: type: string param: type: string nullable: true code: type: string nullable: true ToolCall: type: object properties: id: type: string type: type: string enum: - function function: type: object properties: name: type: string arguments: type: string description: JSON-encoded arguments ResponseFormat: oneOf: - type: object properties: type: type: string enum: - text - type: object properties: type: type: string enum: - json_object - type: object required: - type - json_schema properties: type: type: string enum: - json_schema json_schema: type: object required: - name - schema properties: name: type: string strict: type: boolean default: false schema: type: object description: JSON Schema ChatCompletionChunk: type: object properties: id: type: string object: type: string example: chat.completion.chunk created: type: integer model: type: string choices: type: array items: type: object properties: index: type: integer delta: $ref: '#/components/schemas/ChatMessage' finish_reason: type: string nullable: true ChatMessage: type: object required: - role - content properties: role: type: string enum: - system - user - assistant - tool content: oneOf: - type: string - type: array tool_calls: type: array items: $ref: '#/components/schemas/ToolCall' tool_call_id: type: string Usage: type: object properties: prompt_tokens: type: integer completion_tokens: type: integer total_tokens: type: integer ChatCompletion: type: object required: - id - object - created - model - choices properties: id: type: string example: chatcmpl_abc123 object: type: string example: chat.completion created: type: integer model: type: string choices: type: array items: type: object properties: index: type: integer message: $ref: '#/components/schemas/ChatMessage' finish_reason: type: string enum: - stop - length - tool_calls - content_filter usage: $ref: '#/components/schemas/Usage' securitySchemes: bearerAuth: type: http scheme: bearer description: RunInfra API key. Generate at https://runinfra.ai/settings/api-keys