cuil.si for developers
Build with cuil.si
What you can build
Make images and videos
Start images, videos, voice-overs and transcripts from your own app or server.
Write and schedule posts
Write posts in your brand's voice and publish them to the accounts you connected.
Keep your Library in sync
Upload files, find them, tag them, and use them in posts and edits.
Run automations
Start an automation when something happens on your side, and approve its steps.
Follow results
Read how your published posts are doing, for your own reports.
Send leads
Add people from your site, shop or CRM to Leads, and move them along your pipeline.
Hear about changes
Get a signed webhook when a video is ready or a post goes live.
Quick start
- 1
Get an API key
Sign in to cuil.si and open Settings › Developers › API keys. A workspace admin can make a key; it is shown once, so copy it somewhere safe. Sign in to get a key.
- 2
Check that it works
Ask who the key belongs to. Every address starts with
https://cuil.si/api/v1.curl "https://cuil.si/api/v1/auth/me" \ -H "Authorization: Bearer $CUILSI_API_KEY" - 3
Make an image
Start an image, then ask for it every few seconds until it's ready. The finished file is saved to your Library. It uses the same credits as in the app.
# Start the image. It answers at once with an id and "status": "queued". curl -X POST "https://cuil.si/api/v1/generations" \ -H "Authorization: Bearer $CUILSI_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 6f1c2b9e-2f0a-4c55-9d3e-3b1a7c0e9a12" \ -d '{"kind": "image", "mode": "t2i", "prompt": "A cozy coffee shop at sunrise, warm light"}' # Ask every few seconds until "status" is "succeeded" (or "failed"). curl "https://cuil.si/api/v1/generations/GENERATION_ID" -H "Authorization: Bearer $CUILSI_API_KEY"
Next: the guides walk through common jobs, and the API reference lists every operation.
Authentication
Send your API key in every request, in this header:
Authorization: Bearer gin_live_...- Keep the key on your server. It works like a password for your workspace, so never put it in a web page or an app people download. Call the API from your server.
- A key belongs to one workspace and acts as the person who made it, with their role in that workspace today. If they leave the workspace, the key stops working.
- Full-access keys can create, change and publish. Read-only keys can only look things up (GET requests, plus checking addresses against the do-not-contact list), which suits dashboards and reports.
- Team, billing, account and API-key settings are for people, so keys can't use them. Connecting a social account also needs a person in the app.
- Revoke a key in Settings › Developers at any time. It stops working at once.
Errors
Every error has the same shape: a code your program can check, and a friendly message you can show to people. Codes never change within v1; messages may get clearer.
HTTP/1.1 403 Forbidden
Content-Type: application/json
X-Request-Id: req_4f9a1c2e7b3d5a6f8e0c1b2a
{
"error": {
"code": "not_in_public_api",
"message": "This part of cuil.si isn't available through the API. See https://cuil.si/developers for what is.",
"request_id": "req_4f9a1c2e7b3d5a6f8e0c1b2a"
}
}When a field is wrong (422), the error also lists each field and what is wrong with it:
{
"error": {
"code": "invalid_input",
"message": "Kind is required.",
"fields": [{ "field": "kind", "message": "Kind is required." }],
"request_id": "req_0b7d3e5f1a2c4e6a8c9d0f1e"
}
}| Code | Status | What it means | What to do |
|---|---|---|---|
not_signed_in | 401 | No API key was sent. | Send the Authorization header with your key. |
invalid_api_key | 401 | The key is wrong or revoked, or the person who made it left the workspace. | Make a new key in Settings › Developers. |
read_only_key | 403 | A read-only key tried to change something (checking the do-not-contact list is fine). | Use a full-access key for changes. |
not_in_public_api | 403 | That part of cuil.si isn't in the public API (team, billing and account settings are for people). | Use the operations in the API reference. |
youtube_not_in_api | 403 | YouTube's rules keep its data in cuil.si, so a YouTube post's results aren't in the API. | See them in cuil.si. |
ads_in_automation | 403 | For now, keys can't make, change, switch on or run an automation that reads ad results (the ads Weekly summary, or “Look at ad results” in “Let AI do a task”) or has an ad step. | Leave those steps out, or make the automation in cuil.si. |
youtube_in_automation | 403 | Keys can't make, change, switch on, run or approve an automation that posts to YouTube. They can still switch it off or delete it. | Take the YouTube channel out of its “Publish a post” steps, or do it in cuil.si. |
scope_missing | 403 | The key isn't allowed to do this. The error names the permission it needs, in missing_scope. | Make a key with that permission in Settings › Developers › API keys (or choose Full access). |
forbidden | 403 | The key's owner doesn't have the role this needs (for example, a viewer can't create). | Ask a workspace admin to change the role, or use another person's key. |
email_not_verified | 403 | The person behind the key hasn't confirmed their email address yet. | Confirm the email from the message cuil.si sent. |
not_found | 404 | It doesn't exist, or it belongs to another workspace. | Check the id. Ids come from the list operations. |
insufficient_credits | 402 | The workspace doesn't have enough credits. The error says how many are needed and available. | Add credits in the app, use a cheaper quality level, or remove the link from an X post. |
do_not_contact | 409 | The lead is on the do-not-contact list, so this (a lookup, an email check, a draft email, a task to contact them) isn't done. | Nothing to fix: they asked not to be contacted. |
permission_withdrawn | 409 | The lead said no to this, for example to sales emails or to phone calls. For a lookup or an email check: every answer of theirs is no, or they said no to something and the basis you sent isn't on their record. | Respect it. Only the person can say yes again. For a lookup or an email check after a no to something, leave out `basis` to use a reason already on their record. |
lead_form_no_ai | 409 | The lead came from a lead form in a Google, Facebook or LinkedIn ad. Those leads aren't sent to AI for now, so it wasn't graded or written to with AI. | Score it with your rules (scoreLead) or write to them yourself. |
deal_exists | 409 | The lead already has an open deal in that pipeline. The error has its deal_id. | Change that deal instead of adding another. |
google_ads_not_sent | 409 | For now, Google Ads alerts aren't sent to webhooks, so an older one can't be sent again. | See the alert in cuil.si. |
request_in_progress | 409 | A retry-safe request with the same key is still running. | Wait for Retry-After seconds and send it again to get its answer. |
too_large | 413 | The file or body is too big. | Uploads can be up to 500 MB; other bodies are much smaller. |
unsupported_type | 415 | That kind of file isn't supported. | Upload an image, video or audio file. |
invalid_input | 422 | Something in the request is wrong. fields says what, field by field. | Fix the fields named in the error. |
youtube_needs_you | 422 | Keys can't post to YouTube, so they can't move a YouTube post either. Making or sending one answers invalid_post with the same message. | Post to YouTube from the calendar in cuil.si, or with an automation made there. |
idempotency_key_reused | 422 | A retry-safe key was sent again with a different request (another body, path or API key). | Use a new key for each new request, and the same key only for retries of the same one. |
basis_required | 422 | Looking someone up (or checking their email) needs a lawful reason, and none was sent or recorded. | Send `basis`, for example existing_customer. It is kept with the lookup and doesn't change what you may send them. |
basis_not_allowed | 422 | That reason doesn't allow this lookup. why says which rule: enquiry_only (they only sent an enquiry), reason_not_on_record ("they agreed" or "they asked" isn't on their record), india_rule (a business contact in India) or country_unknown (a lead with no email and no phone whose country nobody knows yet: add their country or their company's first). | For enquiry_only, no reason you send helps until the person says yes to more, or you record another reason first (POST /leads/{lead_id}/consents). On its own, that reason doesn't let cuil.si send them news, offers or newsletters by email: that needs their own yes. Otherwise send another reason that is true for them, such as existing_customer (b2b_prospect isn't allowed for people in India). |
too_many_requests | 429 | More than 120 requests in a minute with this key. | Wait for Retry-After seconds (also in the error as `retry_after_s`), then carry on. |
provider_busy | 429 | The data providers asked us to slow down. | Wait for Retry-After seconds (`retry_after_s`) and try again. |
daily_limit | 429 | The workspace (or one provider connection) has used its lookups for the last 24 hours. | Wait for Retry-After seconds (`retry_after_s`), or ask an admin to raise the limit. |
server_error | 500 | Something went wrong on our side. | Try again in a moment. If it keeps happening, send us the request id. |
Request ids
Every answer has an X-Request-Id header, and the errors you get with an API key carry the same id as error.request_id. Please include it when you ask us about a request.
You can also send your own id in the same header (8 to 64 letters, digits, dots, dashes or underscores) to match our answer to your own logs. Anything else is replaced with a new id.
Lists and pages
Lists that can grow (generations, Library files, posts, runs, deliveries, credit history...) come in pages: { "items": [...], "next_cursor": "..." }, newest first. Ask for up to 100 at a time with limit (30 if you leave it out), and pass cursor=next_cursor for the next page. On the last page, next_cursor is null.
Short lists (brands, characters, voices, social accounts, networks and templates) are a plain list without pages.
const headers = { Authorization: `Bearer ${process.env.CUILSI_API_KEY}` };
let cursor = null;
do {
const url = new URL("https://cuil.si/api/v1/assets");
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const page = await fetch(url, { headers }).then((r) => r.json());
for (const asset of page.items) console.log(asset.name);
cursor = page.next_cursor; // null on the last page
} while (cursor);Rate limits
Each key can send up to 120 requests a minute. Every answer to a key says where you stand: X-RateLimit-Limit (requests per minute), X-RateLimit-Remaining (left in this minute) and X-RateLimit-Reset (seconds until another one is allowed).
Over the limit you get 429 too_many_requests with a Retry-After header: wait that many seconds and carry on. Spreading requests out (or using webhooks instead of asking over and over) keeps you well under it. Every 429 also says how long to wait in the error itself, as retry_after_s (seconds).
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 117
X-RateLimit-Reset: 42
# Over the limit:
HTTP/1.1 429 Too Many Requests
Retry-After: 12
X-RateLimit-Remaining: 0Retry-safe requests
Networks fail. If your request to make an image times out, did it start or not? To retry without paying twice, send a unique value (a UUID is fine) in the Idempotency-Key header with the requests marked Retry-safe in the reference: those that use credits or create something. Then:
- Sending the same request with the same value again within 24 hours gives you the first answer back, exactly as it was, with
Idempotent-Replayed: true. Nothing runs twice and no credits are used twice. - The same value with a different body (or path, or API key) is refused with
422 idempotency_key_reused. Use a new value for each new request. - If the first request is still running, you get
409 request_in_progresswithRetry-After. Wait and send it again to get its answer. - Only answers that worked (2xx) are kept. If a request fails, nothing is kept, so you can fix it and send it again with the same value.
- Answers bigger than 1 MB aren't kept, and file uploads aren't covered (check your Library for the file's name instead). In the rare case that our server stops right after saving your request but before keeping its answer, a retry after 5 minutes runs it again.
# Make one value per request (a UUID is fine) and keep it for the retries.
KEY=$(uuidgen)
curl -X POST "https://cuil.si/api/v1/social/posts" \
-H "Authorization: Bearer $CUILSI_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $KEY" \
-d '{"text": "Our cold brew is back!", "targets": [{"account_id": "ACCOUNT_ID"}]}'
# Timed out? Send exactly the same request with the same key. You get the first answer back,
# with "Idempotent-Replayed: true", and the post is only made once.Webhooks
Instead of asking again and again, let cuil.si tell you: add a webhook endpoint (in Settings › Developers or through the API) and we send a signed POST to your server when a video is ready, a post goes live, an automation finishes and more.
AI assistants (MCP)
cuil.si has an MCP server at https://cuil.si/api/v1/mcp, so Claude and other AI assistants can work in your workspace with an API key: make pictures, write and schedule posts, run automations.
Versions and changes
Our promise for v1. Everything marked stable keeps working as documented. Within v1 we only add things: new operations, new optional fields in requests, new fields in answers, new event types and new values in lists of choices. Your code should ignore fields and values it doesn't know.
Breaking changes (removing or renaming an operation or a field, a new required field, or a field that means something else) only come in a new version, /api/v2. v1 keeps working for at least 12 months after v2 is out.
Things we plan to remove are announced in the changelog below, and by email to the people who made API keys, at least 6 months ahead. Until they go, they answer with a Deprecation header (RFC 9745), a Sunset header (RFC 8594) with the last day, and a Link header to the announcement.
Beta operations are marked beta in the reference and can change with 30 days' notice.
Security fixes can change how something works without notice when people's data is at risk.
When a platform's rules or the law ask for a change, it can come sooner and without a new version, and the changelog says what changed and why.
Changelog
13 November 2026 · Leads and AI assistants
Until we've checked Google's terms, leads from the lead forms in Google Ads ads stay away from AI, as Facebook and LinkedIn ones already do: scoreLeadWithAi and writeSalesEmail answer 409 lead_form_no_ai for them. A key can't switch on a form's thank-you email to Google Ads leads (403); people in cuil.si can. A lead can now have no email and no phone (only a LinkedIn address, or a name and a company), and createLead also finds an existing lead by its LinkedIn address, or by its name and company. The do-not-contact list can show two new kinds, linkedin and name, left when a lead is erased; keys still add only email, domain or phone. New values: why country_unknown (a lookup refused because the person's country isn't known) and the reason no_yes (they haven't said yes to news and offers). AI assistants: create_movie and approve_movie_step now wait in Waiting for you until someone on your team says OK, and the MCP lead tools give a lead from an ad lead form as its id only, and leave it out of searches.
13 November 2026 · No YouTube posts from keys
To follow YouTube's API rules, keys and AI assistants can't post to YouTube any more, as with TikTok: posts to YouTube come only from people in cuil.si and the automations they set up there. With a key, a post that would go to a YouTube channel answers 422 invalid_post, and moving one answers 422 youtube_needs_you; saving it as a draft still works. A key can't make, change, switch on, run or approve an automation that posts to YouTube (403 youtube_in_automation), but can switch it off or delete it. The MCP tools schedule_post and publish_post_now no longer take YouTube choices.
12 November 2026 · YouTube and Google Ads data
To follow YouTube's and Google's API rules, keys no longer get data from YouTube: a YouTube channel's name is “YouTube channel” with no handle or picture, a YouTube post has no video link or numbers, post results leave YouTube out, and getPublicationResults answers 403 youtube_not_in_api for a YouTube post. For YouTube, post.published sends account_name and external_url as null, and post.failed sends account_name as null. For now, there is no Google Ads data either: ads.campaign.alert isn't sent for Google Ads campaigns (resendDelivery answers 409 google_ads_not_sent for an older one), a key can't make, change, switch on or run an automation that reads ad results or has an ad step (403 ads_in_automation), and in a workspace with Google Ads a run shows a short note instead of the steps that read ad results, ad steps and the steps after them.
27 October 2026 · v1 published
The public API, its reference and these docs are live. Keys now only reach the operations in the reference; request ids, rate-limit headers and retry-safe requests are new.
Anything we plan to remove will be listed here with its last day. A status page for the API is on the way.