Use the OpenAI SDK with EpochLLM

EpochLLM provides an OpenAI-compatible API for supported models. Point the OpenAI SDK at EpochLLM, then choose an available model ID. Model capabilities and supported parameters can vary.

Before you start

Create an API key in the dashboard, store it in the EPOCH_API_KEY environment variable, and fund your account before inference. Account creation is free; the minimum top-up payment is $5. Keep the key on your server and out of source control.

Choose a model and send a request

Install the Python SDK with pip install openai. Browse the model catalog or call GET /v1/models with your key to find an available model. Replace the placeholder with its exact ID.

Python chat completion
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["EPOCH_API_KEY"],
    base_url="https://epochllm.com/v1",
)
response = client.chat.completions.create(
    model="YOUR_MODEL_ID",
    messages=[{"role": "user", "content": "Say hello."}],
)
print(response.choices[0].message.content)

On supported models, set reasoning_effort for Chat Completions or reasoning.effort for Responses. Both are JSON request fields. Check the text API reference for endpoint and parameter limitations.

To choose a provider and require a minimum discount on the same model, see the provider pinning guide and SDK examples. For video and music, use the media job endpoints.