What you will build
You will send one text request to RunBridge AI’s OpenAI-compatiblePOST /v1/chat/completions route, print the assistant message, and keep the request shape ready for apps that already use OpenAI SDKs.
When to use this page
Use this quickstart when one of these matches your project:- You already use OpenAI SDKs or Chat Completions request shapes.
- You want to switch the base URL to RunBridge AI.
- You want to call a RunBridge AI model ID through an OpenAI API-compatible route.
Prerequisites
- A RunBridge AI API key stored in
RUNBRIDGE_API_KEY - A text model ID from the Models page
curl, Python 3.10+, or Node.js 18+
API key, base URL, authentication
Use the RunBridge AI base URL with OpenAI-compatible clients:Code examples
Use the tabs below to send the same Chat Completions request with cURL, Python, and Node.js.Flow explanation
OpenAI-compatible means your application keeps the Chat Completions endpoint, request body, and SDK method names while changing the base URL and model ID to RunBridge AI values. The route is synchronous by default. The API returns the completed response object in one HTTP response, and your application readschoices[0].message.content.
For incremental output, set stream to true. The response becomes Server-Sent Events and ends with data: [DONE]. Use streaming for chat interfaces and long responses. Keep the synchronous form for background jobs and simple tests.
Common parameters
Troubleshooting and FAQ
Is this the OpenAI API?
Is this the OpenAI API?
No. This is RunBridge AI’s OpenAI-compatible API route. You use a RunBridge AI API key, the RunBridge AI base URL, and a RunBridge AI model ID.
The request returns 401
The request returns 401
Confirm that
RUNBRIDGE_API_KEY is set in the same shell or runtime that sends the request. Do not paste a real key into source files.The model is not found
The model is not found
Use a RunBridge AI model ID that supports text or chat requests. Check the Models page before retrying.
The SDK still calls OpenAI
The SDK still calls OpenAI
Confirm the client sets
base_url in Python or baseURL in Node.js to https://api.runbridge.ai/v1.Next steps
- Read the Chat Completions API reference.
- Configure SDK clients in Use RunBridge AI with OpenAI SDKs.
- List available models with List available RunBridge AI models.
- Add retry and rate-limit handling with Error codes and retry strategy.