Sign in to view your API credits and key.
Use your API key to call the Coralflavor API. Credits are charged per token.
Pricing: $2.20 per 1M input tokens · $3.40 per 1M output tokens
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="")