/projects/{project_id}/branches/{branch_id}/ai_gatewayGet branch AI Gateway endpointReturns the AI Gateway endpoint host for the specified branch, used to render code-snippet base URLs. A 200 response means the branch is registered and this region serves the AI gateway. A 404 response includes a reason field indicating why the gateway is unavailable.
Note: This endpoint is currently in Beta.
Parameters
project_idstringpathrequiredThe Neon project ID
branch_idstringpathrequiredThe Neon branch ID
Responses
base_urlstring · urirequiredThe AI-gateway endpoint root for this branch — an OpenAI-compatible base URL. No dialect path is included; clients append the route (e.g. `/ai-gateway/openai/v1/responses`) themselves.
enabledbooleanrequiredAlways `true` in 200 responses. Present for forward compatibility, mirroring BranchStorage.enabled.
{
"base_url": "https://br-cool-moon-42-api.ai.c-2.local.neon.build",
"enabled": true
}codestringrequiredmessagestringrequiredreasonstringrequiredMachine-readable reason why the AI gateway is unavailable: - `ai_gateway_unavailable`: the project's region/cell has no AI gateway configured. - `branch_not_found`: the project or branch does not exist, or the caller does not have access to it.
{
"code": "AI_GATEWAY_NOT_ENABLED",
"message": "string",
"reason": "ai_gateway_unavailable"
}codestringrequiredmessagestringrequiredError message
request_idstringUnique identifier for the request, useful for debugging. You can set this value manually by including an `X-Request-ID` header in the request. If not provided, the value will be generated automatically.
{
"code": "",
"message": "string",
"request_id": "string"
}