Sign in to view your API credits and key.
Use your API key to call the Coralflavor API. Credits are charged per token.
Pricing: $7.00 per 1M tokens (input + output) · +$0.10 per request when websearch: true
Use this OpenAI compatible key in the Authorization: Bearer <key> header. Base URL:
Use the official openai package with base_url and api_key. Same interface as OpenAI.
# pip install openai
from openai import OpenAI
client = OpenAI(
base_url="/v1",
api_key="YOUR_API_KEY", # from Reveal & copy above
)
response = client.chat.completions.create(
model="Coralflavor",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
Streaming (same API, stream=True):
stream = client.chat.completions.create(
model="Coralflavor",
messages=[{"role": "user", "content": "Hello!"}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
Web search grounding (websearch: true, +$0.10 per request):
response = client.chat.completions.create(
model="Coralflavor",
messages=[{"role": "user", "content": "What happened in AI this week?"}],
extra_body={"websearch": True},
)
print(response.choices[0].message.content)