Quickstart
The EmberCloud API provides a unified, OpenAI-compatible endpoint that gives you access to open source models through a single API. Use any existing OpenAI SDK or HTTP client — just change the base URL and API key.
Tip: EmberCloud is fully compatible with the OpenAI SDK. If you're already using OpenAI, you only need to change two lines of code.
Using the OpenAI SDK
The fastest way to get started. Install the OpenAI SDK and point it at EmberCloud.
from openai import OpenAI
client = OpenAI(
base_url="https://api.embercloud.ai/v1",
api_key="your-api-key",
)
completion = client.chat.completions.create(
model="glm-4.7",
messages=[
{"role": "user", "content": "What is the meaning of life?"}
],
)
print(completion.choices[0].message.content)Direct API Calls
You can also call the API directly using any HTTP client. The API follows the OpenAI chat completions format.
import requests
response = requests.post(
"https://api.embercloud.ai/v1/chat/completions",
headers={
"Authorization": "Bearer your-api-key",
"Content-Type": "application/json",
},
json={
"model": "glm-4.7",
"messages": [
{"role": "user", "content": "Hello!"}
],
},
)
print(response.json()["choices"][0]["message"]["content"])