Base URL: http://<host>:<port> (default http://127.0.0.1:3040)
Authentication header required on all /v1/* endpoints:
Authorization: Bearer <aibridge-api-key>Health probe endpoint (no auth required).
{
"status": "ok",
"platform": "ide",
"copilot": "enabled"
}Returns model list in OpenAI-compatible format.
{
"object": "list",
"data": [
{
"id": "gpt-4o",
"object": "model",
"created": 1710000000,
"owned_by": "github-copilot"
}
]
}Notes:
- Uses discovered Copilot models when available.
- Returns fallback list when discovery fails or no project is open.
Returns a single model entry or 404.
OpenAI-compatible chat completions endpoint.
{
"model": "gpt-4o",
"messages": [
{"role": "system", "content": "You are concise."},
{"role": "user", "content": "Tell me a short joke about Java."}
],
"stream": true,
"tools": [
{
"type": "function",
"function": {
"name": "read_file",
"description": "Read a local file",
"parameters": {"type": "object"},
"strict": true
}
}
]
}model: string?messages: ChatMessage[](required)stream: boolean(defaultfalse)tools: ChatTool[]?tool_choice: any?max_tokens: int?temperature: double?
Compatibility notes:
- Unknown request fields are ignored.
tools[].function.strictis accepted.messages[].contentcan be string or array-like OpenAI content blocks; text is flattened.
SSE chunks via text/event-stream:
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[...]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"delta":{},"finish_reason":"stop"}]}
data: [DONE]
A terminal chunk with empty delta and non-null finish_reason is expected OpenAI-style behavior.
OpenAI-style chat.completion JSON with one choice.
Legacy endpoint.
Request:
{
"model": "gpt-4o",
"prompt": "Write one sentence.",
"stream": false
}Behavior:
- Converts prompt payload into chat format and routes to the same pipeline as
/v1/chat/completions.
Typical error JSON:
{"error": "Invalid API Key"}Common status codes:
400: invalid/empty request body401: invalid bearer key404: model not found429: rate limit exceeded503: no project / server capacity / Copilot unavailable504: request timeout500: internal error