Skip to main content
Change the base URL to https://api.cometapi.com/v1 when you use OpenAI-compatible SDKs or endpoints. Keep the endpoint path and request body format from the API reference, then use your CometAPI API key.

Use the correct base URL

The OpenAI-compatible base URL is:

Python base URL

The following Python example changes only the client configuration:

Node.js base URL

The following Node.js example sets the CometAPI base URL:

Test the change

The following request verifies that the base URL and API key work:
A successful response returns a chat completion object:

Common errors

Last modified on June 23, 2026