SHOFIDAO Developers

Build with SHOFIDAO

One platform, three APIs: SHOFIDAO AI (chat, code, agents, images, video, websites), SHOFIDAO Pay (checkout, payment links, refunds, webhooks) and SHOFIDAO Cloud (databases, storage, queues). Start free with test keys; switch to live keys when you go to production.

Test mode · freeKeys start with erisme-sk-test-. 100 requests a day, real chat answers from the fast model (short), sample results for images, video and projects. Nothing is charged. Perfect to build and demo.
Live mode · paid plansKeys start with erisme-sk-live-. Every model and tool for real, counted on your plan and credits, with your plan's limits. From the Plus plan.

Your API keys

SHOFIDAO AI API

The SHOFIDAO AI API is OpenAI-compatible: point any OpenAI SDK to ${ORIGIN}/v1 and use your SHOFIDAO key. Models: erisme-1 (general), erisme-1-code (programming) and erisme-1-agent (uses SHOFIDAO's tools: web, files, images, sites…).

Test and live keys

erisme-sk-test-…Test key. Free on every plan once your email is confirmed. 100 requests a day. Chat answers are real but short (fast model, up to 400 tokens). Image, video, project and publishing endpoints return a sample result with the real response shape and "livemode": false. Test keys only open /v1/….
erisme-sk-live-…Live key. Paid plans (Plus and higher). Every model and tool runs for real and counts on your plan, then on your credits. Responses are the same shape as in test mode.

Create and revoke keys in Your API keys (top of this page). Keep keys on your server: never in a web page or a mobile app. A leaked key can be revoked in one click.

Chat completions

POST/v1/chat/completions
modelerisme-1, erisme-1-code or erisme-1-agent.
messagesThe conversation: [{"role":"user","content":"…"}]. A system message is optional.
streamOptional. true sends the answer as server-sent events, like OpenAI.
temperature, max_tokens, toolsOptional, same meaning as OpenAI.
{ "id": "chatcmpl-…", "object": "chat.completion", "model": "erisme-1",
  "choices": [{ "index": 0, "finish_reason": "stop", "message": { "role": "assistant", "content": "…" } }] }
GET/v1/models

Tools

Each SHOFIDAO tool has its own endpoint. Send JSON, get JSON. Long tasks return a job id (see below).

POST /v1/images/generationsImages from a prompt.
POST /v1/images/editEdit an image you uploaded.
POST /v1/videos/generationsRealistic video clips.
POST /v1/videos/studioEdited videos with voice-over.
POST /v1/ads/videoVideo ads sized for each network.
POST /v1/documentsWord, Excel, PowerPoint and PDF files.
POST /v1/projects/developFull websites and mobile apps (zip).
POST /v1/sites/publishPublish a site on shofidao.com or your domain.
POST /v1/code/runRun code in a sandbox.
POST /v1/search, /v1/browseWeb search with sources, read a page.
POST /v1/products/researchWinning products and suppliers.
POST /v1/uploadsUpload a file to use in other calls.

Long jobs

Videos, projects and books take time. The answer contains a job_id; check it until status is done or error.

GET/v1/jobs/{job_id}
{ "id": "…", "status": "running", "progress": 40, "step": "Rendering scene 2 of 5" }

Limits and pricing

Test keys: 100 requests a day, free. Live keys use your plan's daily and monthly limits (messages, images, video seconds, projects…); past the limit SHOFIDAO uses your credits, only if you have them, and never bills more on its own. See Pricing. Errors: 401 wrong or revoked key, 402/403 plan or limit, 429 too many requests.

Quick start

1. Open your SHOFIDAO Pay account and create a secret key in Pay → Developers. 2. From your server, create a Checkout Session. 3. Send your customer to its url. 4. When the payment succeeds, SHOFIDAO Pay sends checkout.session.completed to your webhook and brings the customer back to your success_url.

Authentication

Send your secret key in the Authorization header. Secret keys start with esk_test_ (test mode) or esk_live_ (live mode). Keep them on your server, never in a web page or a mobile app. A key is tied to one SHOFIDAO Pay account; revoke it any time from the dashboard.

Authorization: Bearer esk_test_xxxxxxxxxxxxxxxxxxxxxxxx

Test mode

Everything works in test mode: checkout, links, refunds, events and webhooks, with no real money. The hosted checkout shows buttons to simulate a successful payment, a declined card and insufficient funds. Objects created in test mode have "livemode": false and ids such as cs_test_….

Errors

Errors use normal HTTP status codes and a JSON body with a human-readable message:

{ "detail": "line_items: send 1 to 100 items, each with name, amount (in cents) and quantity." }
400Something in the request is missing or invalid.
401No key, or the key is wrong or revoked.
403The account cannot do this (not verified, frozen…).
404The object does not exist or is not yours.
409Conflict (for example the same Idempotency-Key used for another request).
429Too many requests. Wait and retry.

Idempotency

Networks fail. Add an Idempotency-Key header to every POST (for example your order id). If you send the same key again within 24 hours, SHOFIDAO Pay returns the first answer and does nothing twice. Replayed answers have the header Idempotent-Replayed: true.

Idempotency-Key: order-1042

Checkout Sessions

A hosted, mobile-friendly payment page for one order. Amounts are integers in cents (2500 = $25.00).

POST/api/pay/v1/checkout/sessions
line_items1 to 100 items: name, amount (cents, at least 50), quantity (default 1), description (optional).
success_urlWhere the customer goes after paying. SHOFIDAO adds ?session_id=cs_….
cancel_urlOptional. The "back" link on the checkout.
customer_emailOptional. Shown on the checkout.
client_reference_idOptional. Your own id (order number), returned in events.
metadataOptional. Up to 20 keys of your own data.
expires_inOptional. Seconds, from 1800 to 86400 (default 24 h).

        

Response

{
  "id": "cs_test_9Zk…", "object": "checkout.session", "status": "open",
  "url": "${ORIGIN}/checkout/cs_test_9Zk…", "amount_total": 5500, "currency": "usd",
  "client_reference_id": "1042", "metadata": {"order": "1042"}, "payment": null, "livemode": false
}

status is open, complete or expired. When complete, payment holds the payment id.

GET/api/pay/v1/checkout/sessions/{id}POST/api/pay/v1/checkout/sessions/{id}/expire

Pay button for any website

No server needed: paste this where the button should appear (replace the link id).

<script src="${ORIGIN}/assets/erisme-pay.js" data-link="k3Jd9aQx" data-label="Buy now"></script>

Payments

Every successful card payment, from checkout or links. fee is the SHOFIDAO Pay fee and net what you receive.

GET/api/pay/v1/paymentsGET/api/pay/v1/payments/{id}
{ "id": "txn_…", "object": "payment", "amount": 5500, "fee": 190, "net": 5310, "amount_refunded": 0,
  "currency": "usd", "status": "succeeded", "source": "checkout", "payer": "Kim", "livemode": false }

Refunds

Give money back from your SHOFIDAO Pay balance, all at once or in parts. Leave out amount to refund what is left. The SHOFIDAO Pay fee of the original payment is not returned.

POST/api/pay/v1/refunds
curl ${ORIGIN}/api/pay/v1/refunds -H "Authorization: Bearer $SHOFIDAO_KEY" \
  -H "Content-Type: application/json" -H "Idempotency-Key: refund-1042" \
  -d '{"payment":"txn_…","amount":500,"reason":"Damaged item"}'

Balance

GET/api/pay/v1/balance
{ "account": "••4821", "currency": "USD", "livemode": false, "posted": 184250, "available": 174250, "incoming": 0 }

available is what you can use now; money held for pending transfers is already taken out.

Transactions

GET/api/pay/v1/transactions?limit=50

Every movement on the account: payments received, refunds, transfers, card purchases.

Events

SHOFIDAO Pay records an event for everything that happens on your account and keeps it so you can catch up at any time.

GET/api/pay/v1/events?type=payment.succeededGET/api/pay/v1/events/{id}
checkout.session.completedA checkout was paid. Fulfil the order here.
checkout.session.expiredA checkout was not paid in time.
payment.succeededMoney received (checkout or link).
payment.failedA card was declined.
refund.succeededA refund was sent.
transfer.received / transfer.sentMoney moved between SHOFIDAO Pay accounts.
transfer.posted / returned / rejectedA bank transfer finished, came back, or was not approved.
card.purchaseA debit card was used.

Webhooks

Add your https:// address in Pay → Developers. SHOFIDAO Pay sends each event as a POST with a JSON body. Answer with any 2xx status within 15 seconds. If your server fails, SHOFIDAO retries after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h and 24 h, then marks it failed; you can resend it from the dashboard. The same event can arrive more than once: ignore event ids you already processed.

{ "id": "evt_…", "object": "event", "type": "checkout.session.completed", "created": 1794000000,
  "livemode": false, "data": { "object": { "id": "cs_test_…", "status": "complete", "client_reference_id": "1042", … } } }

Verify signatures

Every webhook has an SHOFIDAO-Signature header: t=<unix time>,v1=<signature>. Compute HMAC-SHA256 of t + "." + raw body with your webhook secret, compare it with v1 in constant time, and refuse calls older than 5 minutes.

Limits

Up to 600 API calls per minute per key. Checkouts up to $1,000,000; items from $0.50. Daily sending limits and reviews protect accounts; see your limits in the dashboard.