openapi: 3.2.0 info: title: Koreai Chat API version: 1.0.0 x-generated: 'do not edit; source: route contracts' description: 'Operations tagged Chat across 2 of this provider''s published API definitions: koreai-abl-runtime-conversation-openapi.json, koreai-abl-runtime-sessions-openapi.json. Each path carries the servers of the definition it was published in.' tags: - name: Chat paths: /api/v1/chat/agent: post: deprecated: true description: Deprecated — prefer the deployment-scoped `/api/v1/project/{projectSlug}/{env}/agent/{agentSlug}/chat`. Executes a message through the ABL runtime with agent-backed chat; creates a session on first call or reuses one via sessionId. operationId: runtime.legacyChat.agent requestBody: content: application/json: schema: properties: agentId: description: Optional agent override type: string attachmentIds: items: type: string type: array message: description: User message text type: string metadata: additionalProperties: {} type: object projectId: description: Project id type: string sessionId: description: Existing session id to continue the conversation type: string required: - projectId - message type: object responses: '200': content: application/json: schema: properties: action: additionalProperties: {} type: object outcome: type: string response: type: string sessionId: type: string required: - sessionId - response type: object description: Success '401': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error security: - ApiKeyAuth: [] summary: Agent-backed chat (legacy) tags: - Chat /api/v1/chat/agent/stream: post: deprecated: true description: Deprecated — prefer the deployment-scoped `/api/v1/project/{projectSlug}/{env}/agent/{agentSlug}/stream`. Streams tokens and trace events via Server-Sent Events. operationId: runtime.legacyChat.stream requestBody: content: application/json: schema: properties: agentId: description: Optional agent override type: string attachmentIds: items: type: string type: array message: description: User message text type: string metadata: additionalProperties: {} type: object projectId: description: Project id type: string sessionId: description: Existing session id to continue the conversation type: string required: - projectId - message type: object responses: '200': content: text/event-stream: schema: type: string description: Success '401': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error security: - ApiKeyAuth: [] summary: Agent-backed SSE streaming chat (legacy) tags: - Chat /api/v1/chat/complete: post: deprecated: true description: Deprecated — prefer the deployment-scoped `/api/v1/project/{projectSlug}/{env}/agent/{agentSlug}/complete`. Non-streaming completion with model routing and usage tracking. operationId: runtime.legacyChat.complete requestBody: content: application/json: schema: properties: maxTokens: type: number messages: description: Conversation messages items: properties: content: type: string role: enum: - system - user - assistant - tool type: string required: - role - content type: object type: array modelId: type: string projectId: description: Project id type: string temperature: type: number required: - projectId - messages type: object responses: '200': content: application/json: schema: properties: content: type: string finishReason: type: string latencyMs: type: number model: type: string usage: properties: estimatedCost: type: - number - 'null' inputTokens: type: number outputTokens: type: number totalTokens: type: number required: - inputTokens - outputTokens - totalTokens - estimatedCost type: object required: - content - usage - latencyMs type: object description: Success '401': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error security: - ApiKeyAuth: [] summary: Non-streaming chat completion (legacy) tags: - Chat /api/v1/chat/session: post: deprecated: true description: Deprecated — creates a pre-initialized session with optional session metadata. Returns the session ID without executing a message. operationId: runtime.legacyChat.createSession requestBody: content: application/json: schema: properties: agentId: type: string deploymentId: type: string environment: type: string projectId: minLength: 1 type: string sessionMetadata: additionalProperties: {} type: object required: - projectId type: object responses: '200': content: application/json: schema: properties: agentName: type: string sessionId: type: string status: enum: - ready type: string required: - sessionId - agentName - status type: object description: Success '401': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error security: - ApiKeyAuth: [] summary: Create a chat session (legacy) tags: - Chat /api/v1/chat/usage: get: description: Usage metrics for a project with optional date range and grouping. operationId: runtime.legacyChat.getUsage parameters: - description: Project id in: query name: projectId required: true schema: description: Project id type: string - description: ISO 8601 start date in: query name: startDate required: false schema: description: ISO 8601 start date type: string - description: ISO 8601 end date in: query name: endDate required: false schema: description: ISO 8601 end date type: string - description: Group usage by model in: query name: groupBy required: false schema: description: Group usage by model enum: - model type: string responses: '200': content: application/json: schema: properties: byModel: items: properties: modelId: type: string provider: type: string requestCount: type: number totalCost: type: number totalTokens: type: number required: - modelId - provider - totalTokens - totalCost - requestCount type: object type: array summary: properties: avgLatency: type: number requestCount: type: number totalCost: type: number totalTokens: type: number required: - totalTokens - totalCost - requestCount - avgLatency type: object required: - byModel type: object description: Success '401': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized '500': content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Internal server error security: - ApiKeyAuth: [] summary: Get usage metrics (legacy) tags: - Chat components: schemas: ErrorResponse: properties: error: type: string required: - error type: object securitySchemes: ApiKeyAuth: in: header name: x-api-key type: apiKey x-refined-from: - koreai-abl-runtime-conversation-openapi.json - koreai-abl-runtime-sessions-openapi.json