Sidzedze ƒe gɔmeɖoanyi Dɔwɔlawo
Nkplɔ̃nuwo, ɖeƒeɖeɖewo kple embeddings
App ƒome tɔ gbɔgbɔɖididiwo, kple ɖeɖe ƒe dɔwɔnuwo: ƒeɖeɖe, fidiowɔ, ɖeɖe, nuŋɔŋlɔ siwo nye nuŋɔŋlɔ, kple embeddingswo, ɖeka ɖeka ƒe dɔwɔnu si woasi ƒe dɔwɔnu ɖe wò wòƒe kaba.
Woɖe axa sia gɔme to mɔ̃ dzi be wòanɔ bɔbɔe. Eŋlisigbe me gbãtɔae nye gɔmeɖeɖe si sɔ.
Ŋwɔna ƒe dɔwɔwɔnawo ƒe ɖeɖefiaɖeɖe
Ŋɔŋlɔ si wòɖo fofonɔ ɖe fofonɔ womanyẽ kple ɖe nuɖuɖu siwo wòɖo woɖa ɖe woɖo wɔwɔna gɔme la. Enye nuɖuɖu siwo wòɖo wowɔ kple... ?image ɖeka ƒe app me.
POST https://nymbot.ai/api/v1/images/generations — ƒe API key ɖe, alo a Lightning payment per request.
Ids ƒoawo ƒo wò le GET /api/v1/models?type=image. Standard ɖeaɖea la,
@cf/black-forest-labs/flux-1-schnell, costs a flat 5 standard credits (50 sats) a
picture. Every other generator spends Pro credits at its own price, with the usual fee and
margin, as in aplikã la. n Xɔ́wɔwɔwo ƒe taƒoƒo
n ɣeyi ɖeka ɖe nu si wòkpɔ ɖeka gbɔ. Esia nye mɔ si generator melɔ nu o, wòɖu eɖokui ɖe nu si wòɖo ɖe eŋu o;
standard generator la le prompt la ɖe ɖo ko.
| ŊɔŊɔɣi | Nɔnɔme | Enye wòkpɔkpɔɖe | Ŋkɔŋɔ |
|---|---|---|---|
model | nuɖeɖe | Ɛ̃ | Generator ƒe id, ʋeye nye nano-banana. |
prompt | nuɖeɖe | Ɛ̃ | Nuɖeɖe si naxɔ ɖe. Aleɖe ɖeka si ƒe ƒome ƒe 2,000 ɖeka ko nye nu si woaxɔe. |
n | ŋkɔɖeŋkɔ | Ɖeɖe ŋutɔ | 1 ɖe 4. 1 nye ɖokui. Eye wònye gbɔ ɖe nu siwo wòɖoa nu wu nɛ la me nyaɖeɖe wu nyaɖeɖe num_images. |
size | nuɖeɖe | Ɖeɖe ŋutɔ | Awerawuƒe dɔwɔnu aɖe abe "16:9", alo OpenAI ƒe nɔnɔme aɖe ʋeye "1792x1024", siʋe nye nu si ɖo 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 5:4 kple 4:5 la gbɔ tɔŋʋenɔ. "auto" eɖoa eɖokui ɖe dɔɖodziɖe la ƒe asi me. |
aspect_ratio | nuɖeɖe | Ɖeɖe ŋutɔ | vi gbɔ ɖe size, eye eyeɖe ɖeɖe ɖeɖe la gbɔ lia. |
quality | nuɖeɖe | Ɖeɖe ŋutɔ | Generator ƒe nu ɖekaɖeka, didi nye "low", "medium" eve "high". |
negative_prompt | nuɖeɖe | Ɖeɖe ŋutɔ | Nne de be nàɖu ɖe ɖi. |
output_format | nuɖeɖe | Ɖeɖe ŋutɔ | "png", "jpeg" eve "webp". |
response_format | nuɖeɖe | Ɖeɖe ŋutɔ | "url" (nuɖeaɖea la) alo "b64_json". |
image_url | nuɖeɖe | Ɖeɖe ŋutɔ | Nkɔŋ ɖeka si wòɖo ɖe ɖokui me: ɖeka https:// link of at most 4,096 characters with no user name or password in it, or a data:image/…;base64 URL (PNG, JPEG, WebP or GIF; not SVG). Only for generators with edit; eyeɖe ame siwo nya ɖe nya me la requires_image_url. |
resolution eɖe ɖekaɖeka ɖekaɖeka fia eyaɖe xɔxɔe. Viã url,
each picture is uploaded to a public Blossom host and you get its link (a few generators only
hand back a link of their own, which is passed on). Anyone with the link can open it and it
cannot be taken down again; see API la gbɔ ɖe nu kae gbɔna?. Kple
b64_json ŋutikpɔkpɔ la ɖoa ɖe eƒe ɖeɖe me eye wònye ɖe ɖi ɖaɖa, eye wònye ɖe ɖi ɖaɖa o. Ŋutikpɔkpɔ
le ɖe ɖeɖe me be a data: URL le image_url is checked the same way as an
ɖia ɖa eye ɖe Blossom gbãtɔ hã be nye nu si generator la ate ventyConfigɖe ɖe e;
ele dze ɖe ɖe le gbãɣã be ne request la le kpeɖeɖe ɖe dze dzesi le nu si wogbeɖe ɖe o la gbã.
Ne dɔ kekeli wòna nu me la n ŋutikpɔkpɔwo va fɔ, wònye wo dome siwo le dɔ wɔm la, wònye wo ƒe dɔwɔnuwo ɖe ɖe wo ɖe (ɖe nya siwo nye eye dɔwɔnuɖinyaɖuɖu la me siwo va fɔ la ɖe nya me la gbãtɔ) eye, ɖe nymbot.failed eɖe nuɖeaɖe wòɖeaɖe le ɖekawo me ɖe. Ne nuɖeaɖeɖe nyaɖeaɖe ɖe, eɖeɖe ɖe ɖe nyaɖeaɖeɖe la me 502.
Gbɔbɔɖeɖe
{
"created": 1790726400,
"model": "nano-banana",
"cost": 0.2126,
"data": [
{
"url": "https://blossom.example/5c0e4b7d3a91f2e8...c4.png",
"content_type": "image/png"
}
],
"nymbot": { "balance": "pro", "charged_credits": 1.817, "charged_sats": 181.7, "balance_credits": 410.608, "balance_sats": 41060.8 }
}
| Nystatʋe | Fiee? |
|---|---|
400 | Egbɔɖeɖe ɖeɖe; n ƒeɖe 1 ɖo 4 (invalid_value); nɔ ƒe mɔnɔɖeaɖa ɖeɖe (invalid_size) alo livẽ (invalid_image, invalid_image_url); model si le ɖeɖe ɖe gake nye nuɖatiaɖuɖu ƒe model ɣe la (invalid_model); nyadzɔɖe si meɖeaɖeɖe ŋu nɔ o (edit_unsupported); ɖeka si ɖo nya alo foto la ya ɖeɖe ʋu (image_required). |
402 | Meblia ƒe nɔnɔmeɖeɖe la menya dzesi ɖeka ɖeka siwo woɖe asi la gbɔ o. |
404 | Mɔƒo si ƒe dzɔdzɔe nye ɖeyi (model_not_found). |
502 | Meka la dzui (upstream_error). Menye nu siaƒe ɖem nyo o, eye nuɖeɖe meɖe kɔ o, eye xɔxɔ la le... charged_sats. |
503 | Pictures cannot be hosted right now (media_hosting_unavailable). b64_json egbe la dɔ kaba. |
cURL
curl https://nymbot.ai/api/v1/images/generations \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana",
"prompt": "A lighthouse at dusk, oil painting",
"size": "16:9"
}'
Python
import os
import requests
res = requests.post(
"https://nymbot.ai/api/v1/images/generations",
headers={"Authorization": "Bearer " + os.environ["NYMBOT_API_KEY"]},
json={"model": "nano-banana", "prompt": "A lighthouse at dusk, oil painting", "size": "16:9"},
)
res.raise_for_status()
print(res.json()["data"][0]["url"])
JavaScript
const res = await fetch("https://nymbot.ai/api/v1/images/generations", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.NYMBOT_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ model: "nano-banana", prompt: "A lighthouse at dusk, oil painting", size: "16:9" }),
});
const body = await res.json();
console.log(body.data[0].url);
ŋutikpɔkpɔwo ɖaka ɖi
Eɖea ŋutifafa si wòɖo ɖe eŋu ɖe, ɖe fiaɖeɖe si wòɖo ɖe eŋu ɖe. Edzi nye OpenAI ƒe edit endpoint, eye nye OpenAI SDKs ƒe... images.edit eɖoa dɔ ɖeka ɖe. Pro gãɖiɖiwo ko kple edit xɔxɔ nuɖuɖu ƒe
ɖekeɖeke ƒe ƒeɖeɖe me ɖe eme.
POST https://nymbot.ai/api/v1/images/edits — ƒe API key ɖe, alo a Lightning payment per request. Ɖeka la nye multipart/form-data, ɖeka ƒe 32 MB ɖo.
| ŊɔŊɔɣi | Nɔnɔme | Enye wòkpɔkpɔɖe | Ŋkɔŋɔ |
|---|---|---|---|
image | fèblé | Ɛ̃ | Xɔxɔ si wòɖata ɖi: PNG, JPEG, WebP alo GIF, ɖo megabytes 20 gbɔ. Woatsɔ nyaɖe ɖe nyewo hã. image[]; eɖoa nu vevi si gbãtɔe ɖo. |
prompt | nuɖeɖe | Ɛ̃ | Nukae nye si maɖaɖa. |
model | nuɖeɖe | Ɛ̃ | Maketi si ƒe ŋusẽ le ɖom ʋu ɖe... edit. |
n | ŋkɔɖeŋkɔ | Ɖeɖe ŋutɔ | 1 ɖo 4. |
sizeaspect_ratioqualitynegative_promptoutput_format | nuɖeɖe | Ɖeɖe ŋutɔ | As for generation. |
response_format | nuɖeɖe | Ɖeɖe ŋutɔ | "b64_json" (eye si wogbe ɖe sia) alo "url". |
The picture you upload is checked to be a well-formed PNG, JPEG, WebP or GIF, sent on as its real type, and put on a public Blossom host, because the generators fetch their input by link. Treat it as public. If the edit fails and nothing is charged, the hosted copy is deleted again. The response has the same shape as for generation. Pricing is the generator's price, which for some generators includes a charge for the input picture.
Gbɔbɔɖeɖe
{
"created": 1790726460,
"model": "nano-banana",
"cost": 0.2126,
"data": [{ "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..." }],
"nymbot": { "balance": "pro", "charged_credits": 1.817, "charged_sats": 181.7, "balance_credits": 408.791, "balance_sats": 40879.1 }
}
| Nystatʋe | Fiee? |
|---|---|
400 | Dzesi alo kɔm mɔ̃mɔ̃ o, fai si nye dzesi o (invalid_image), alo generator si meɖeɖe ɖeka ɖe nu meɖo o (edit_unsupported). |
413 | Xɔxɔ la ƒe dzesi la ƒo megbe 20 MB (file_too_large), alo akpedeka si le 32 MB wu. |
503 | Xexlẽ sia menye ɖe mɔ dzi ɖe ɖe ɖeka gbɔ bubu o (°media_hosting_unavailable). |
cURL
curl https://nymbot.ai/api/v1/images/edits \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-F model=nano-banana \
-F image=@photo.png \
-F prompt="Make it a snowy evening"
Python
import base64, os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
with open("photo.png", "rb") as f:
result = client.images.edit(model="nano-banana", image=f, prompt="Make it a snowy evening")
with open("edited.png", "wb") as out:
out.write(base64.b64decode(result.data[0].b64_json))
JavaScript
import fs from "node:fs";
import { writeFile } from "node:fs/promises";
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const result = await client.images.edit({
model: "nano-banana",
image: fs.createReadStream("photo.png"),
prompt: "Make it a snowy evening",
});
await writeFile("edited.png", Buffer.from(result.data[0].b64_json, "base64"));
Videwo
A video takes minutes, so it runs in the background. You submit it, get an id straight away, and ask about the id until it is done. Every video generator spends the Pro balance.
POST https://nymbot.ai/api/v1/videos — ƒe API key ɖe, alo a Lightning payment per requestDziɖeɖe 202.
| ŊɔŊɔɣi | Nɔnɔme | Enye wòkpɔkpɔɖe | Ŋkɔŋɔ |
|---|---|---|---|
model | nuɖeɖe | Ɛ̃ | Video dzigbeɖeɖe ƒe ID si ƒe ʋia ɖe... GET /api/v1/models?type=video, be gbɔ ɖeɖe menya nyawo siwo nya ɖe nya me taɖeɖe mè, be veo. |
prompt | nuɖeɖe | Ɛ̃ | Nuameɖe nye wòɖe ɖeɖe le gbɔ. |
duration | nɔŋuti alo dzidzedze | Ɖeɖe ŋutɔ | Nɔnɔme si le ƒe dzesi le nukpɔkpɔ nuwo ƒe ŋkeke me, 0 wu wu eye wòɖo 60. Wònye ɖekae na generator siwo le nuwɔna si wòɖo nuwɔna ƒe nɔnɔme me ɖe wò; ebiawo laa wo ɖokui nɔnɔme siwo woɖo ɖe ɖe asi, si nye nu ka? seconds ɖe nya la me kple taƒe la ɖe ɖe. |
aspect_ratio | nuɖeɖe | Ɖeɖe ŋutɔ | Nya nu si nye "16:9" eve "9:16"; ɖeka si ƒe gã ɖe ɖe ɖe nya siʋu nyaɖeɖe "1280x720" nye nuŋkpɔkpɔ si le gɔmeɖeɖeɖe gbɔ la. |
resolutionquality | nuɖeɖe | Ɖeɖe ŋutɔ | Generator ƒe viɖe ɖeka resolutions model ƒe nɔnɔmeɖeɖewo me, abe... "720p" eve "1080p". Eƒe taƒoƒo ɖa. Any deɖe bubu la ɖe nuɖeɖe le unsupported_resolution. |
image_url | nuɖeɖe | Ɖeɖe ŋutɔ | Nkɔŋ ɖeka si wòɖo ɖe ɖokui me: ɖeka https:// link alo a data:image/… URL, which is uploaded to a public Blossom host first. Required by generators with requires_image_url. |
ɖokpe siwo le gãawo la le ɖokui me ɖekae ne èɖoa ɖe eŋu, tso generator, resolution kple length ƒe nuɖeɖe me, ɖe èyaɖe eŋu la, wòanya eŋu tso wò Pro balance me beɖe nuɖeɖe si provider la ɖoa ɖe eŋu la, eye wòawɔ nu si nye
cost, estimated_cost kple nymbot. If the provider refuses
the job, nothing is charged. If the render later fails, or the finished clip cannot be stored
and the provider did not bill for it, the charge is refunded once, automatically. A render that
is still going after an hour is given up, and keeps its charge, because the provider bills a
render once it accepts it. A refund returns the credits but does not lower the key's spend
count.
Aɖeɖe (202)
{
"id": "vid_3e9a51c07b2f4d86e0a1c4f2",
"object": "video",
"model": "veo",
"status": "in_progress",
"created": 1790726400,
"seconds": 8,
"resolution": "1080p",
"estimated_cost": 3.18,
"expires_at": 1790812800,
"cost": 3.18,
"nymbot": { "balance": "pro", "charged_credits": 31.8, "charged_sats": 3180, "balance_credits": 378.808, "balance_sats": 37880.8 }
}
status starts as in_progress, alo completed video la ƒe ɖe
ya la le eme data ɣeɖe gbɔna generator la ɖo ɖeka ɖeɖe be.
Mekpɔ nɔ video ɖeka dzi ɖe nya kpeɖeɖe me
GET https://nymbot.ai/api/v1/videos/{id} — ƒeɖu mɔkpɔkpɔ si nye nym si ɖe ɖe nya la ƒe mɔkpɔkpɔ. Mɔkpɔkpɔ si ɖo eƒe nuɖeɖewo nu la ɔ, nɛ la ɔ le dzesi ɖe ɖe ɖeɖe gɔme hã.
E va ɖe nu 202 ɣe video la ɖeaɖea la kple 200 ɣesia wòɖo
ɖo alo eɖu akɔ; ɖo ɖe nu ɖea ɖe ɖe 5 kple 10 dzroɖanɖe. Ŋɔŋlɔ ɖeka ɖeka ɖe nuɖatia ɖe ɖeka eye eɖoa eɖomɔ
ɖe ɖeka; eɖea nu ɖe video la gbɔ gake alo; dɔwɔwɔ ɖeka ɖeka kɔ ɖe ɣe 24 megbe be wowɔe.
GET /api/v1/videos lɔlɔ̃ si nɔ dɔwɔwɔ wu 50 si nya la yi nye
{"object": "list", "data": […]}.
Ɖeɖe (200)
{
"id": "vid_3e9a51c07b2f4d86e0a1c4f2",
"object": "video",
"model": "veo",
"status": "completed",
"created": 1790726400,
"seconds": 8,
"resolution": "1080p",
"estimated_cost": 3.18,
"expires_at": 1790812800,
"completed_at": 1790726590,
"data": { "url": "https://blossom.example/9b41d0c2e7a3f658...1e.mp4", "content_type": "video/mp4" },
"cost": 3.18,
"nymbot": { "balance": "pro", "charged_credits": 31.8, "charged_sats": 3180 }
}
status e nya in_progress, completed eve failedDɔ si meɖe ɖu... error ({"code": "generation_failed", "message": …});
ɖe ɖu ɖe ɖi, cost 0 kple ƒeɖe ɖe? nymbot lẽawo
refunded_credits kple refunded_sats. Video si wòwɔ ɖe la le Blossom host si gbɔkpɔ gbɔ kpɔ ɖe, be ảnhiwo si wòwɔ ɖe nya ɖe.
| Nystatʋe | Fiee? |
|---|---|
400 | Nukuɖeaɖe aɖe; nuɖeɖe si le 0 kple 60 ɖomeɖome (invalid_value); mɔ̃nu si generator la meɖe o (unsupported_resolution); sɔƒuɖuɖu aɖe si ɖo nuɖuɖu si ɖo sɔƒuɖuɖu si ɖo nuɖuɖu aɖe (image_required); nuɖuɖuɖutɔ si nye videowɔwɔla menye (invalid_model). |
402 | Pro balance la menya video la ɖe ɖe. |
404 | Enye nuɖeɖeɖe bubu alo generator alo ʋee ɖeɖeɖe menia (model_not_found), alo dɔwɔwɔ aɖe si melɔ id sia gbɔ na wò nym la me o, alo eɖo ʋu 24 ƒe ʋu ɖe ʋu (video_not_found). |
429 | Wò nym ƒe vidio 10 la ɖe ɖi ɖea wò ɖi ɖe awurubɔɖi (video_jobs_limit). Xɔ̃ ɖeɖe wo eye ɖe ɖeka wutu la, ɖe ɖeka bubu ɖe. |
502 | Gegenerator la ɖe dɔ la ɖe. Mawó ado ebia ame si me nnyeɖeɖeɖe ɖe nɔa aɖewo gbãtɔ gbãtɔa me o. |
503 | Videos cannot be delivered or stored right now (media_hosting_unavailable, service_unavailable). |
cURL
curl https://nymbot.ai/api/v1/videos \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "veo", "prompt": "Waves rolling onto a beach at sunrise", "duration": 8, "aspect_ratio": "16:9"}'
curl https://nymbot.ai/api/v1/videos/vid_3e9a51c07b2f4d86 \
-H "Authorization: Bearer $NYMBOT_API_KEY"
Python
import os, time
import requests
headers = {"Authorization": "Bearer " + os.environ["NYMBOT_API_KEY"]}
job = requests.post(
"https://nymbot.ai/api/v1/videos",
headers=headers,
json={"model": "veo", "prompt": "Waves rolling onto a beach at sunrise", "duration": 8, "aspect_ratio": "16:9"},
).json()
while True:
time.sleep(8)
status = requests.get("https://nymbot.ai/api/v1/videos/" + job["id"], headers=headers).json()
if status["status"] in ("completed", "failed"):
break
print(status["data"]["url"] if status["status"] == "completed" else status["error"])
JavaScript
const headers = {
"Authorization": "Bearer " + process.env.NYMBOT_API_KEY,
"Content-Type": "application/json",
};
const job = await (await fetch("https://nymbot.ai/api/v1/videos", {
method: "POST",
headers,
body: JSON.stringify({ model: "veo", prompt: "Waves rolling onto a beach at sunrise", duration: 8, aspect_ratio: "16:9" }),
})).json();
let status;
do {
await new Promise((r) => setTimeout(r, 8000));
status = await (await fetch("https://nymbot.ai/api/v1/videos/" + job.id, { headers })).json();
} while (status.status !== "completed" && status.status !== "failed");
console.log(status.status === "completed" ? status.data.url : status.error);
Takpala ɖe nuŋɔŋlɔ me
Nuŋɔŋlɔwo le ɖe ɖe eye wòana audio ƒe nuŋɔŋlɔla ɖeka, eye menye link ene o. Enye OpenAI ƒe speech endpoint, eye... audio.speech.create OpenAI SDKswo me wòɖo nya.
POST https://nymbot.ai/api/v1/audio/speech — ƒe API key ɖe, alo a Lightning payment per request.
| ŊɔŊɔɣi | Nɔnɔme | Enye wòkpɔkpɔɖe | Ŋkɔŋɔ |
|---|---|---|---|
model | nuɖeɖe | Ɖeɖe ŋutɔ | ɖagbɔɖagbɔ ƒe nuɖuɖu ƒe mɔɖoɖo si wòkpɔ le audio ƒetẽɖiɖiwo ƒe dzesi ƒetẽɖiɖi. Nusi wòɖo ɖe: ɖuɖu si nye nusi, @cf/myshell-ai/melotts. aura-2 Deepgram Aura 2 wònye nyemɔ? |
input | nuɖeɖe | Ɛ̃ | The text to read: up to 800 characters for the standard voice, 2,000 for Aura 2. |
voice | nuɖeɖe | Ɖeɖe ŋutɔ | Ŋkɔ nuƒome ɖe... ŋkɔɖɔɖɔ ƒe ɖekaɖeawo ƒe ƒeŋɔŋlɔɖa: Aura speaker abeɖe ɖeka si nye luna (ɖo aura-2-luna-en), alo MeloTTS gbɔɖeɖe (en, es, fr, zh). OpenAI ƒe ɖe ŋkɔwo abe kple nye alloy wowoe ɖoa eye wole nuɖasiɖasi si nyawo ƒe dzesi le gbɔ. |
language | nuɖeɖe | Ɖeɖe ŋutɔ | ɖɔɖɔ ƒe kɔ abe nu si nye es. Ŋgɔ matekpɔ ɖeɖeɖe o la, eɖea ɖeka na nyagbe sia. Ŋgɔ si ƒoa nyagbe bubu la ƒoa ɖa. 422 voice_language_mismatch, eye nuɖeɖe si model la ƒe nya mele eme la 422 unsupported_language. |
response_format | nuɖeɖe | Ɖeɖe ŋutɔ | Ŋkɔɖɔɖɔ gbãtɔ la ɖoɖo ɖoɖo ɖo mp3 ɖekae. Aura 2 ƒoɖo ɖeɖe mp3 (eƒe nuɖoligbe), opus, aac, flac, wav eve pcm. |
speed | kakpapla | Ɖeɖe ŋutɔ | Ɖe ɖe ɖokui kple ɖe ɖokui mɔ. |
The standard voice costs a flat 3 standard credits (30 sats) a request, as in the app. Aura 2
is Pro, priced by the characters you send. The response body is the audio, with a matching
Content-Type; tsea la le ɖe X-Nymbot-Cost-Sats ŋkpɔkpɔɖe. Ne
ɖeŋuɖeɖuŋu ƒe model la gblẽ la, menye nu siwo va ɖe gbɔ o.
Gbɔbɔɖeɖe
HTTP/1.1 200 OK
Content-Type: audio/mpeg
X-Nymbot-Cost-Sats: 4.2
X-Nymbot-Balance-Sats: 41055.6
(audio bytes)
| Nystatʋe | Fiee? |
|---|---|
400 | ŊɔŊɔ ɖeɖe; ŋɔŊɔ ƒo model ƒe bɔbɔ dzi (input_too_long); nuŋuta ƒe dzesi si dɔwɔnu sia menya ɖe esi (unsupported_response_format); ɖu madzeɖeɖe (invalid_voice); mɔƒoɖeƒe aɖe si nye nuƒoƒo mɔƒoɖeƒe o (invalid_model). |
422 | Ŋgɔ bubu la ɖo nu si wòɖo ɖe nuŋɔŋlɔ la me la nya la o, alo model la ya ɖe nuŋɔŋlɔ la ƒe ŋgɔ bubu la me o. |
502 | Ŋɔŋlɔɖeɖe nya ƒe model la gblẽ. Nuɖeɖe aɖe meɖe ɖe. |
cURL
curl https://nymbot.ai/api/v1/audio/speech \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "aura-2", "voice": "luna", "input": "Your invoice has been paid."}' \
--output speech.mp3
Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
audio = client.audio.speech.create(
model="aura-2",
voice="luna",
input="Your invoice has been paid.",
)
audio.write_to_file("speech.mp3")
JavaScript
import { writeFile } from "node:fs/promises";
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const audio = await client.audio.speech.create({
model: "aura-2",
voice: "luna",
input: "Your invoice has been paid.",
});
await writeFile("speech.mp3", Buffer.from(await audio.arrayBuffer()));
Audio mɔƒoƒowo kple ŋkɔwo
Ŋkɔɖodziɖi ƒe lisi ɖekawo siwo le gbɔɖea me ɖe nu si wòkpɔ ɖe nuŋɔŋlɔɖeɖe alo ɖe dɔwɔnu ƒe nyaɖeɖe ƒe nuŋɔŋlɔ ɖe nu kpɔɖeŋu me gbãtɔ. Aura 2 ƒe ɖeɖeɖe ƒe nyaɖeɖe 41 ƒe ɖeɖeɖewo le eme eye MeloTTS ƒe nuŋɔŋlɔ ƒe gbɔgbɔɖeɖe ƒia nɔ ɖe ɖekawo me.
GET https://nymbot.ai/api/v1/audio/models — no key needed.
GET https://nymbot.ai/api/v1/audio/voices?language=en — no key needed.
| ŊɔŊɔɣi | Nɔnɔme | Enye wòkpɔkpɔɖe | Ŋkɔŋɔ |
|---|---|---|---|
language | ŋkɔ (nanya) | Ɖeɖe ŋutɔ | Esia ɖe nyawo ko ɖe eʋegbe sia gbɔ. |
model | ŋkɔ (nanya) | Ɖeɖe ŋutɔ | Yi ɖeka ɖe nyawo ko na bevi sia. |
ŊɔŊɔ (ŋkɔʋinyadeƒeๆ)
{
"object": "list",
"data": [
{ "id": "luna", "name": "Luna", "provider": "deepgram", "model_id": "aura-2", "models": ["aura-2"], "language": "en", "description": "Aura 2 English voice", "gender": "female", "preview_url": null },
{ "id": "en", "name": "MeloTTS English", "provider": "myshell", "model_id": "@cf/myshell-ai/melotts", "models": ["@cf/myshell-ai/melotts", "melotts"], "language": "en", "description": "English (MeloTTS)", "gender": null, "preview_url": null }
]
}
Mɔƒumɔ̃wo ɖea ŋutinyawo ɖe asi. {"object": "list", "data": {"tts": […], "stt": […]}}.
Ŋɔŋlɔ dzesi ɖeka ɖeka ɖea eƒe nɔnɔme, nuƒometɔ, max_input_chars,
response_formats, languages kple default_voice; transcription model la ɖoa e ƒe ŋkɔ bubuwo, max_file_bytes, max_seconds,
ɖomɖomewo kple ƒeɖeɖe ɖe min ɖe ɖeke.
cURL
curl https://nymbot.ai/api/v1/audio/models
curl "https://nymbot.ai/api/v1/audio/voices?language=en"
Python
import requests
print(requests.get("https://nymbot.ai/api/v1/audio/models").json())
for voice in requests.get("https://nymbot.ai/api/v1/audio/voices", params={"language": "en"}).json()["data"]:
print(voice["id"], voice["model_id"])
JavaScript
console.log(await (await fetch("https://nymbot.ai/api/v1/audio/models")).json());
const voices = await (await fetch("https://nymbot.ai/api/v1/audio/voices?language=en")).json();
for (const v of voices.data) console.log(v.id, v.model_id);
Nuŋɔŋlɔ me ɖeɖe
Whisper ɖe nuŋɔŋlɔ ƒe nuɖe ɖe nuŋɔŋlɔ me. Esia nye OpenAI ƒe transcription endpoint, ɖe na
audio.transcriptions.create wɔ dɔ.
POST https://nymbot.ai/api/v1/audio/transcriptions — ƒe API key ɖe, alo a Lightning payment per request. Ɖeka la nye multipart/form-data.
| ŊɔŊɔɣi | Nɔnɔme | Enye wòkpɔkpɔɖe | Ŋkɔŋɔ |
|---|---|---|---|
file | fèblé | Ɛ̃ | Ŋkɔɖo la, ɖe 256 bytes ɖetɔ̃ kple 25 MB ɖo, eye wònye ŋkɔɖo 30 minutes ɖo: WAV, WebM, MP4 alo M4A, Ogg alo Opus, MP3 kpleya ƒe ƒome siwo Whisper mlãna. MP3 kple yaƒe ƒome siwo ƒe dɔɖɔ la meɖo nu ɖe wò ɖeʋeɖeɖe aloɖeɖe me la, wotsɔ 1.8 MB ɖo. |
model | nuɖeɖe | Ɖeɖe ŋutɔ | Si wònye ɖeɖe whisper, si nye Whisper Large v3 Turboe. whisper-1, whisper-large-v3-turbo kple @cf/openai/whisper-large-v3-turbo nye nu ɖeka. |
language | nuɖeɖe | Ɖeɖe ŋutɔ | Ŋɔŋlɔ si wòƒo la, be aɖe ɖe... en. Woawɔ nu si woɖo ɖe tasia la me la. |
prompt | nuɖeɖe | Ɖeɖe ŋutɔ | Nɔnɔwo alo dzesiwo si wòkpɔkpɔ ɖeɖe, abe nyatakɔwo me. Nɔnɔwo 1,000 gbãtɔwo ko nye siwo wotsɔna. |
response_format | nuɖeɖe | Ɖeɖe ŋutɔ | json (eƒe nuɖoligbe), text, srt, vtt eve verbose_json. |
For WAV, WebM, MP4 and Ogg files the length is read from the file before anything runs, so a
recording over 30 minutes is refused up front (with 3 seconds' grace). A WAV file's length comes
from its sample rate, channels and sample size. The length of other formats, such as MP3, cannot
be read up front, so they are limited by size: at the lowest bitrate Nymbot assumes, 8 kbps,
30 minutes is 1.8 MB, and a larger file in such a format is refused with 413
audio_too_long megbe nuɖiɖi ɖeka meɖeɖe. Mèɖaɖɔ nuɖiɖiwo gbɔ ɖekaɖeka me ɖe WAV, WebM, MP4 alo Ogg me.
Ne Whisper ɖe nuɖiɖiwo be wole ʒi 30 gbɔ oɖe, eɖe ɖe nuɖiɖi sia gbɔ be wole meɖeɖe o le
413 audio_too_long, and since Whisper did run, 30 minutes are
charged.
You pay for the length of the audio, rounded up to the second: the longest of the length read
from the file, the length Whisper reports, and the least the file's size allows, at Whisper's per-minute price
with the usual fee and margin, and at least 0.05 credit a request. It is paid from the standard
balance when that can cover the hold, and from Pro otherwise; a 402 ɖoa nu si ɖeka ɖeka ƒe
balance la ɖunaɖuna la. Le app la me la, ɖe nu si wogblɔ le nuƒoa me la menye meɖeɖe gɔme o; le API la me la,
womana wònye ɣe ɖeka ɖeka ɖe. Ne Whisper gblẽ la, wòade ɣe ɖeka o.
Gbɔbɔɖeɖe
{
"text": "Your invoice has been paid.",
"usage": { "type": "duration", "seconds": 3 },
"nymbot": { "balance": "standard", "charged_credits": 0.05, "charged_sats": 0.5, "balance_credits": 120.35, "balance_sats": 1203.5 }
}
text ɖea tɔŋɔ si ƒo, srt kple vtt ɖe subtitleswo ɖe, kple
verbose_json ɖoa nuɖeaɖe, ɖeɖefia, kple ɣeyiɣi ɖeka ɖekawo. Nuɖeaɖe etɔ̃ siwo menye JSON menye, woƒe dɔwɔwɔ ƒe nuɖeaɖe le headers me.
| Nystatʋe | Fiee? |
|---|---|
400 | Filiɖeɖe la me, fili si me nuɖuɖuɖu (audio) aɖe si me xɔxɔ le o (invalid_audio), amemediɖeɖe aɖe si nɔa xɔɖiɖi, alo model si menye transcription model nye (invalid_model). |
402 | Anyi ƒe nɔnɔme ɖekaɖe me menye anyi kaba menye kpeɖeŋu nɛ agbeɖeɖe la menye. |
413 | Dokument la ƒe ƒetɛ la ɖe 25 MB wu (file_too_large) or the recording over 30 minutes, or, in a format whose length cannot be read up front, over 1.8 MB (audio_too_long). |
502 | Whisper ɖu audio la me dɔ la. Womaxɔ nu ɖekaɖe o. |
cURL
curl https://nymbot.ai/api/v1/audio/transcriptions \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-F file=@memo.m4a \
-F model=whisper \
-F response_format=json
Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
with open("memo.m4a", "rb") as f:
transcript = client.audio.transcriptions.create(model="whisper", file=f)
print(transcript.text)
JavaScript
import fs from "node:fs";
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const transcript = await client.audio.transcriptions.create({
model: "whisper",
file: fs.createReadStream("memo.m4a"),
});
console.log(transcript.text);
Ŋɔŋlɔ siwo ƒo ɖe nuŋɔŋlɔ me ɖo Eglisigbe me ɖeɖe
POST https://nymbot.ai/api/v1/audio/translations — ƒe API key ɖe, alo a Lightning payment per request. Ɖeka la nye multipart/form-data.
Eƒe ɖokpe ɖe nuɖodziɖodzi ƒe dɔwɔwɔ la gbãtɔ, eye nuɖodziɖodzi ƒe dɔwɔwɔ la ƒe dɔwɔwɔwo ɖeka ɖe, si nye... language, ɖemegbe kple
ƒe ɖɔ, gake taktakla la va ɖo ɖekui ɖe English dzi ɖeka nu, nuɖeɖe si wòɖo ɖeɖe la nya ɖe. OpenAI SDKs la ɖe nya le
eŋu be audio.translations.create.
cURL
curl https://nymbot.ai/api/v1/audio/translations \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-F file=@nota.m4a \
-F model=whisper
Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
with open("nota.m4a", "rb") as f:
translation = client.audio.translations.create(model="whisper", file=f)
print(translation.text)
JavaScript
import fs from "node:fs";
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const translation = await client.audio.translations.create({
model: "whisper",
file: fs.createReadStream("nota.m4a"),
});
console.log(translation.text);
Embeddings
Ŋɔŋlɔwo ɖe vektoƒe me be woanya ɖe nu si wòɖeaɖa ɖe nuɖeɖe, ɖe nuwo ɖe ɖeka me, kple ɖe nu siwo ƒo ɖe ɖeka me. Modeliwo ƒe dɔwɔwɔwo le Cloudflare dzi eye wogbe nu si wònye standard balance la.
POST https://nymbot.ai/api/v1/embeddings — ƒe API key ɖe, alo a Lightning payment per request.
| ŊɔŊɔɣi | Nɔnɔme | Enye wòkpɔkpɔɖe | Ŋkɔŋɔ |
|---|---|---|---|
model | nuɖeɖe | Ɛ̃ | Embedding model si si ɖe nya si wòɖo gbãtã si ɖo... GET /api/v1/models?type=embedding. |
input | ŋutinya alo ŋutinyiwo ƒe nuɖasiɖesiɖesi | Ɛ̃ | Ŋuti si wòɖo ɖe eme la, ɖeka ɖeka ɖo 100 siwo me nu bubu le la. Token arrayswo gbɔna (token_input_unsupported). Any nu si wòɖo ɖe dɔme la gbɔa ŋu be wòɖo dɔme nya si model la ƒe context_length, ɖeɖe be ɖeka ɖe nye ƒe etɔ̃ ɖeka bytes ɖokui ɖe. |
encoding_format | nuɖeɖe | Ɖeɖe ŋutɔ | float (nuɖeaɖea la) alo base64 (little-endian 32-bit floats). |
dimensions | ŋkɔɖeŋkɔ | Ɖeɖe ŋutɔ | Mɔƒo si eme model la me le la, alo na model si ƒe ŋutinya nye supported_dimensions wo nu siawo ƒe ɖeka; esiaɖe vektor la ɖe ɖeke eye wòɖe eŋu. Nu bubu ɖeka la me hã, wole ɖeka. |
| Mɔ̃lã | Ŋkuãɖuɖuwo | Nyuiaɖeɖe |
|---|---|---|
@cf/baai/bge-m3 | 1024, gbɔ nuɖuɖu geɖeɖe le}}}} | 8,192 tokens |
@cf/qwen/qwen3-embedding-0.6b | 1024, gbɔ nuɖuɖu geɖeɖe le}}}} | 8,192 tokens |
@cf/baai/bge-large-en-v1.5 | 1024, Inglish | 512 tokens |
@cf/baai/bge-base-en-v1.5 | 768, Ingliɖi | 512 tokens |
@cf/baai/bge-small-en-v1.5 | 384, Inglis | 512 tokens |
The models list is the source of truth for which are available and what they cost; Google's EmbeddingGemma, with shorter vectors on request, appears there too when the catalog has a price for it. Embeddings are metered per input token, and the 0.05-credit minimum applies to each request, not to each input, so batching many texts into one request is much cheaper than sending them one at a time.
Gbɔbɔɖeɖe
{
"object": "list",
"data": [
{ "object": "embedding", "index": 0, "embedding": [0.0213, -0.0487, 0.0112] }
],
"model": "@cf/baai/bge-m3",
"usage": { "prompt_tokens": 9, "total_tokens": 9 },
"nymbot": { "balance": "standard", "charged_credits": 0.05, "charged_sats": 0.5, "balance_credits": 1204.35, "balance_sats": 12043.5 }
}
| Nystatʋe | Fiee? |
|---|---|
400 | Mebiaɖeɖe la meɖeɖe o alo eve si meɖeɖe o; token ƒe nuɖuɖuwo (token_input_unsupported); nu siwo woɖo adzã eji vi (too_many_inputs); nuɖometatã si ƒe ƒe ɖe ɖi ɖe model la ƒe ƒe ɖe ɖi ɖe wu (input_too_long); ŋutɔ si model la meɖe o (unsupported_dimensions). |
402 | Standard balance la ɖo ɖeaɖea. Embeddings mɔna Pro balance la ɖokpɔɖokpɔ. |
404 | No embedding model by that name. |
502 | Mɔɖe la gblẽ. Nuɖeɖe aɖe me ɖeɖe o. |
cURL
curl https://nymbot.ai/api/v1/embeddings \
-H "Authorization: Bearer $NYMBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "@cf/baai/bge-m3", "input": ["Lightning invoices expire.", "Invoices on Lightning have a time limit."]}'
Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://nymbot.ai/api/v1", api_key=os.environ["NYMBOT_API_KEY"])
result = client.embeddings.create(
model="@cf/baai/bge-m3",
input=["Lightning invoices expire.", "Invoices on Lightning have a time limit."],
)
print(len(result.data), len(result.data[0].embedding))
JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://nymbot.ai/api/v1", apiKey: process.env.NYMBOT_API_KEY });
const result = await client.embeddings.create({
model: "@cf/baai/bge-m3",
input: ["Lightning invoices expire.", "Invoices on Lightning have a time limit."],
});
console.log(result.data.length, result.data[0].embedding.length);