Documentation Index
Fetch the complete documentation index at: https://docs.eachlabs.ai/llms.txt
Use this file to discover all available pages before exploring further.
1. Install the OpenAI SDK
2. Generate Your First Image
from openai import OpenAI
client = OpenAI(
api_key="YOUR_EACHLABS_API_KEY",
base_url="https://eachsense-agent.core.eachlabs.run/v1"
)
response = client.chat.completions.create(
model="eachsense/beta",
messages=[{
"role": "user",
"content": "Generate a cyberpunk cityscape at night with neon lights"
}],
stream=False
)
print(response.choices[0].message.content)
# Access generated media URLs
print(response.generations)
3. Stream Responses
Enable streaming to get real-time updates:
stream = client.chat.completions.create(
model="eachsense/beta",
messages=[{"role": "user", "content": "Create a 5-second video of ocean waves"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
4. Multi-Turn Conversation
Use session_id to maintain context:
import requests
import json
SESSION_ID = "my-first-session"
HEADERS = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
URL = "https://eachsense-agent.core.eachlabs.run/v1/chat/completions"
# Turn 1: Generate an image
requests.post(URL, headers=HEADERS, json={
"messages": [{"role": "user", "content": "Generate a portrait photo"}],
"session_id": SESSION_ID,
"stream": False
})
# Turn 2: Modify it (agent remembers the previous generation)
requests.post(URL, headers=HEADERS, json={
"messages": [{"role": "user", "content": "Now make it anime style"}],
"session_id": SESSION_ID,
"stream": False
})
Next Steps