Skip to main content
Run inference against your deployed models with the Python SDK, cURL, or any OpenAI-compatible client. The API follows industry-standard formats — LLM endpoints match OpenAI’s v1/chat/completions and v1/completions, and embeddings match v1/embeddings.
Test requests interactively in the Playground and copy the generated code into your application.

Installation

Install the Python SDK:

Authentication

Initialize the client or send a request with your API key. Treat the key like a password.

Create and manage API keys

Set the environment variable:

Initialize the client

Send a request

Replace your-model-id with the ID from the Models page (click Model ID on your deployment).

Stream a response

Add stream=True to receive tokens as they are generated:
See Streaming for SSE format details and production tips.

Next steps

  • Browse Examples for every supported pipeline task.
  • Migrate from OpenAI if you already use OpenAI-compatible libraries.
  • Read the API overview for errors, rate limits, and endpoint compatibility.