Skip to content

For API Integrators

Casola exposes OpenAI-compatible endpoints, so existing SDKs and tools work without changes. Create a token, make your first call, and set up a workflow — all in about ten minutes.

  1. Sign in at casola.ai and go to Tokens (/tokens).
  2. Click Create token. Select the User Access scope group (user:read + user:write) — this covers all inference and data operations.
  3. Copy the token immediately. It’s only displayed once.

For service accounts or CI pipelines, admins can create tokens with narrower scopes. See the API Tokens guide and Scopes reference for the full list.

Casola’s base URL is https://api.casola.ai. All OpenAI-compatible endpoints live under /openai/v1/.

Terminal window
curl https://api.casola.ai/openai/v1/images/generations \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "flux",
"prompt": "a neon-lit alley in the rain",
"size": "1024x1024"
}'
from openai import OpenAI
client = OpenAI(
base_url="https://api.casola.ai/openai/v1",
api_key="YOUR_TOKEN",
)
response = client.images.generate(
model="flux",
prompt="a neon-lit alley in the rain",
size="1024x1024",
)
print(response.data[0].url)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.casola.ai/openai/v1",
apiKey: "YOUR_TOKEN",
});
const response = await client.images.generate({
model: "flux",
prompt: "a neon-lit alley in the rain",
size: "1024x1024",
});
console.log(response.data[0].url);

Video generation and other heavy tasks can take longer than a typical HTTP timeout. Add "async": true to your request body to get a 202 response with a request ID, then poll for the result:

Terminal window
# Submit
curl -X POST https://api.casola.ai/openai/v1/images/generations \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"model": "flux", "prompt": "a sunset timelapse", "async": true}'
# Poll (replace REQUEST_ID)
curl https://api.casola.ai/fal/requests/REQUEST_ID \
-H "Authorization: Bearer YOUR_TOKEN"

Workflows let you chain multiple models into a pipeline — for example, generate an image, then upscale it, then convert to video.

  1. Go to Workflows (/workflows/new) in the UI to build a workflow visually.
  2. Or create one via the API — see the Workflows guide for the DAG format and execution endpoints.

Browse available models and their current status at /models or via the API:

Terminal window
curl https://api.casola.ai/openai/v1/models \
-H "Authorization: Bearer YOUR_TOKEN"

Model status (online, warming up, standby, offline) is available at /api/model-status. See the Models reference for capabilities, latency profiles, and supported parameters.