API Integration
Use our OpenAI-compatible chat completions API to integrate with any platform.
API Integration
The API integration provides an OpenAI-compatible chat completions endpoint that you can use to interact with your Pathors project.
Chat Completions
Path Parameters
The ID of your project
Request Headers
Bearer token authentication using your API key
Request Body
Array of messages in the conversation. Each message should have a role
(“system”, “user”, or “assistant”) and content
.
Whether to stream the response. Defaults to false.
Optional session ID for conversation continuity.
Example request:
Response
Unique identifier for the completion
Object type (“chat.completion”)
Unix timestamp of when the completion was created
Model used for the completion
Array of completion choices
Session ID for the conversation
Example response:
Streaming Response
When stream
is set to true
, the response will be a stream of server-sent events (SSE). Each event contains a chunk of the response in the following format:
The final chunk will have finish_reason: "stop"
and will be followed by data: [DONE]
.
Error Responses
Status Code | Description |
---|---|
400 | Invalid request body |
401 | Invalid authentication |
500 | Internal server error |
Setup Guide
- Enable the API integration in your Pathors project settings
- Generate an API key in your project’s integration settings
- Use the API key in the Authorization header for your requests