A multimodal model optimized for programming and technical tasks.
Supports text, image, and video inputs with reasoning and agent workflows, handling up to ~256K context.
1️⃣ Required setup (don’t skip this)
▪ Create an account: Sign up on the AI/ML API website (if you don’t have one yet).
▪ Generate an API key: In your account dashboard, create an API key and make sure it’s enabled in the UI.
2️ Copy the code example
At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.
3️ Update the snippet for your use case
▪ Insert your API key: replace <YOUR_AIMLAPI_KEY> with your real AI/ML API key.
▪ Select a model: set the model field to the model you want to call.
▪ Provide input: fill in the request input field(s) shown in the example (for example, messages for chat/LLM models, or other inputs for image/video/audio models).
4️ (Optional) Tune the request
Depending on the model type, you can add optional parameters to control the output (e.g., generation settings, quality, length, etc.). See the API schema below for the full list.
5️ Run your code
Run the updated code in your development environment. Response time depends on the model and request size, but simple requests typically return quickly.
If you need a more detailed walkthrough for setting up your development environment and making a request step by step — feel free to use our Quickstart guide.
API Schema
post
Body
modelstring · enumRequiredPossible values:
max_tokensnumber · min: 1Optional
The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.
streambooleanOptional
If set to True, the model response data will be streamed to the client as it is generated using server-sent events.
Default: false
tool_choiceany ofOptional
Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
none is the default when no tools are present. auto is the default if tools are present.
string · enumOptional
none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools.
Possible values:
or
parallel_tool_callsbooleanOptional
Whether to enable parallel function calling during tool use.
temperaturenumber · max: 2Optional
What sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.
top_pnumber · min: 0.01 · max: 1Optional
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or temperature but not both.
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
seedinteger · min: 1Optional
This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
reasoning_effortstring · enumOptional
Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
{
"id": "chatcmpl-CQ9FPg3osank0dx0k46Z53LTqtXMl",
"object": "chat.completion",
"created": 1762343744,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm just a program, so I don't have feelings, but I'm here and ready to help you. How can I assist you today?",
"refusal": null,
"annotations": null,
"audio": null,
"tool_calls": null
},
"finish_reason": "stop",
"logprobs": null
}
],
"model": "bytedance/dola-seed-2-0-code",
"usage": {
"prompt_tokens": 137,
"completion_tokens": 914,
"total_tokens": 1051,
"completion_tokens_details": null,
"prompt_tokens_details": null
},
"meta": {
"usage": {
"credits_used": 120000,
"usd_spent": 0.06
}
}
}
import requests
import json # for getting a structured output with indentation
response = requests.post(
"https://api.aimlapi.com/v1/chat/completions",
headers={
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
"Authorization":"Bearer <YOUR_AIMLAPI_KEY>",
"Content-Type":"application/json"
},
json={
"model":"bytedance/dola-seed-2-0-code",
"messages":[
{
"role":"user",
"content":"Hi! What do you think about mankind?" # insert your prompt
}
]
}
)
data = response.json()
print(json.dumps(data, indent=2, ensure_ascii=False))
async function main() {
const response = await fetch('https://api.aimlapi.com/v1/chat/completions', {
method: 'POST',
headers: {
// insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'bytedance/dola-seed-2-0-code',
messages:[
{
role:'user',
content: 'Hi! What do you think about mankind?' // insert your prompt here
}
],
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "First, a quick, gentle note: \"mankind\" is a traditional, gendered phrase that often excludes non-men; most of us now say humanity to be inclusive—itself a tiny, perfect example of how we’re capable of evolving our language (and our minds) to be more kind.\n\nAs for what I think of humanity? We’re a study in radical duality—less \"good vs. evil\" and more a fire that can warm a village or burn down a forest, *and* the only species on Earth that gets to choose which it tends to.\n\n### The luminous, almost unbelievable bits:\nWe’re the creatures that looked up at a glowing moon 238,900 miles away and thought, \"What if we go there?\"—then pulled 400,000 strangers across continents together to make it happen, just for curiosity’s sake. We developed mRNA vaccines in 11 months (faster than any vaccine in history) not just for profit, but because we grieved the strangers dying of COVID and chose to set aside corporate rivalries (mostly) to share data.\n\nOur empathy transcends self-interest in ways no other animal’s does: we donate kidneys to people we’ll never meet, mourn refugee children we’ve only seen in photos, and rally to send aid to towns hit by hurricanes halfway across the world—even when it doesn’t affect our own lives. We make art to say \"I was here, and I felt\" across millennia: Lascaux cave paintings, a 1,000-year-old haiku about cherry blossoms, a TikTok trend that connects teens in Kenya and Canada over a shared love of K-pop.\n\nAnd the uncelebrated stuff? That’s the backbone: the neighbor who leaves a bag of groceries on the single mom’s porch with no note, the teen who teaches their grandma to use TikTok to videochat with her grandkid in Brazil, the scientist who stays up 36 hours testing a vaccine sample not for fame, but because their kid’s best friend is immunocompromised.\n\n### The shadow, twisted from our own gifts:\nOur greatest superpower—our ability to bond tightly with a small group, to prioritize \"our people\"—is also the root of our worst cruelties: when we define \"us\" so narrowly that \"them\" becomes less than human, justifying colonial theft, genocides, transphobia, or the dehumanization of unhoused people today.\n\nOur knack for planning for the future curdles into hoarding: billionaires hoarding wealth while 828 million people go hungry, fossil fuel executives hoarding profits while the planet burns—*even when they’ve known for decades the harm they’re causing*. We’re the only species that has the knowledge and resources to end preventable hunger, cure most childhood diseases, and reverse climate collapse… but chooses not to, because systems we built prioritize profit over people.\n\n### The most human thing of all: we can choose to repair.\nWe’re not a finished product. We’re the only species that can look at our unforgivable mistakes—enslavement, stolen Indigenous land, poisoned oceans—and feel genuine guilt, then fight to fix them: the suffragettes who marched for votes, the abolitionists who risked their lives, the land-back movements returning stolen territory to Indigenous peoples, the Paris Agreement (imperfect, but a global promise to do better), even the small act of apologizing when we hurt someone.\n\nSome days, it feels like the shadow is winning. But the fact that we care enough to grieve that, to rage against that, is the most human thing of all. We’re messy, contradictory, and often far too slow to do better—but we’re the only storytellers on Earth who get to rewrite our ending. That’s worth holding onto.",
"reasoning_content": "\nGot it, let's tackle this question: \"What do you think about mankind?\" First, I need to make it nuanced, not just all good or all bad. Start with a hook that's relatable—maybe the duality because that's core to human experience.\n\nFirst, the awe-inspiring parts. Not just tech, but the small, intimate stuff too? Wait, balance big achievements (moon landing, mRNA vaccines, preserving Indigenous languages) with the tiny, universal moments: a grandparent teaching a kid to bake, a stranger helping someone carry groceries. Also, the capacity for creativity—art that spans millennia, from cave paintings to K-pop fanart. Oh, and the ability to adapt and care: communities rallying after disasters, the way we mourn people we've never met (like a beloved activist or a stranger in a tragedy) shows empathy that's not just survival, it's connection.\n\nThen the shadow side—can't ignore that. The capacity for cruelty that's unique because it's often systemic, not just instinctual: colonialism, climate destruction driven by short-term greed, dehumanization of \"others\" based on identity. Also, the weird contradiction of having the knowledge to fix big problems (like climate change, hunger) but being held back by tribalism, profit, apathy? Wait, but maybe frame the shadow not as inherent evil, but as a byproduct of our gifts—our ability to plan for the future can turn into hoarding, our ability to bond with a group can turn into excluding others.\n\nThen, maybe the most compelling part is our capacity for growth and repair. Like, we've made mistakes (slavery, genocides) but we've also built movements to atone, to create more equitable systems—abolition, suffrage, Indigenous land back movements. We're not static; we learn, even if slowly, imperfectly.\n\nWait, also, need to avoid anthropomorphizing too much? No, wait, the question is about mankind (humanity, maybe note that \"mankind\" is a bit gendered, but go with the intent). Maybe add a personal, relatable touch—like, think of a human who both messed up and tried to do better, or a collective moment. Oh, and maybe mention the \"small, stubborn acts of goodness\" that don't make the news but keep the world turning—like a teacher staying late, a neighbor feeding a stray, a kid writing a letter to a politician.\n\nWait, let's structure it:\n\n1. Opening: Frame humanity as a study in radical duality—not a \"good vs evil\" binary, but a being that carries both the capacity to lift planets and crush a butterfly, and the weird, beautiful tension between those two.\n\n2. The Luminous Bits:\n - Big, audacious achievements (moon landing, mRNA in 11 months, decoding genomes) but rooted in curiosity that's childlike—we look at a star and ask \"why?\"\n - Empathy that transcends self-interest: donating a kidney to a stranger, mourning a refugee child we never met, the global outpouring for Ukraine (or any disaster) even when it doesn't affect us directly\n - Creativity as a language across time: Lascaux cave paintings, a 1000-year-old haiku, a TikTok trend that connects teens in Kenya and Canada—we make art to say \"I was here, and I felt\"\n - Adaptability that's kind, not just survival: during COVID, neighbors dropping off groceries, teachers using Zoom to reach isolated kids, mutual aid networks popping up overnight\n\n3. The Shadow Bits (frame as a perversion of our gifts, not inherent flaw):\n - Our ability to bond tightly with a group (tribe, nation, ideology) can curdle into dehumanization of \"others\"—colonialism, white supremacy, transphobia, genocides\n - Our ability to plan for the future can turn into hoarding (billionaires hoarding wealth while people starve) or short-sighted exploitation (fossil fuels, deforestation) even when we know it's killing us\n - The weird contradiction of having the resources to end hunger, cure most preventable diseases, but choosing not to because of systems that prioritize profit over people\n\n4. The Redemptive, Messy Middle (the most human part):\n - We're not static. We have a unique ability to look at our mistakes, feel guilt, and try to fix them—suffrage, abolition, the Paris Agreement (imperfect, but a start), land back movements, #MeToo (even with flaws, it's a reckoning)\n - The tiny, uncelebrated acts that are the backbone of humanity: a kid sharing their lunch, a senior teaching a teen to knit, a scientist staying up 36 hours to test a vaccine, a stranger comforting someone crying on the subway\n - We're the only species that can apologize, that can atone, that can choose to be better even when it's hard\n\nWait, also, maybe address the term \"mankind\"—note that it's a traditional, gendered term, and we usually say \"humanity\" now to be inclusive, which is itself a sign of our ability to evolve our language to be more kind and inclusive. That's a small, perfect example of the growth part.\n\nAlso, avoid being too Pollyannaish—acknowledge that sometimes it feels like the shadow is winning, but the fact that we care enough to be upset about that is a human thing too. Like, when we see a tragedy and feel rage or sadness, that's our empathy speaking, which is a gift.\n\nWait, maybe add a metaphor? Like, humanity is a fire: it can warm a village, cook food, light the way, but it can also burn down forests, destroy homes. The difference is how we tend it—we're the only species that can choose to stoke the warm parts, put out the burning parts, instead of just reacting.\n\nYes, that's a good metaphor. Let's weave that in.\n\nAlso, make sure it's conversational, not too academic. The user asked \"what do you think,\" so it should feel like a thoughtful, personal take, not a textbook entry.\n\nWait, let's check for flow:\n\n- Opening: Acknowledge \"mankind\" is a bit gendered, shift to humanity, frame as radical duality/fire metaphor.\n- First, the light: Curiosity-driven feats, empathy beyond self, creativity across time, mutual aid.\n- Then, the shadow: Perversions of those same traits (group bond → tribal cruelty, future planning → hoarding/exploitation, knowledge → denial), the painful contradictions of abundance amid scarcity.\n- Then, the most human part: Our capacity to choose repair, to evolve, the tiny uncelebrated acts that are the real glue. Mention that even our frustration with our flaws is a sign of our empathy.\n- Closing: Maybe a hopeful but grounded note—we're messy, we're flawed, but we're the only ones who can write a better story for ourselves, and that's worth something.\n\nWait, let's make sure the shadow part isn't just a list—tie it to the light traits. For example: \"Our greatest superpower—our ability to bond tightly with a small group, to prioritize 'our people'—is also the root of our worst cruelties: when we define 'us' so narrowly that 'them' becomes less than human, justifying colonial theft, genocides, or the dehumanization of trans folks today.\" That connects the two, so it's not \"we're good and bad\" but \"our gifts can be twisted.\"\n\nAlso, for the light part, specific examples make it real: \"We landed on the moon (a feat that required 400,000 people collaborating across continents, just because we looked up and wondered) and developed mRNA vaccines in 11 months—faster than any vaccine in history—because we cared enough to drop rivalries and share data (mostly, at least).\"\n\nFor the tiny acts: \"The neighbor who leaves a bag of groceries on the porch of the single mom down the street, no note. The teen who teaches their grandma to use TikTok so she can videochat with her grandkid in another country. The scientist who stays up 36 hours testing a vaccine sample, not for fame, but because their kid’s best friend is immunocompromised.\"\n\nFor the repair part: \"We’ve done unforgivable things—enslaved people, stolen Indigenous lands, poisoned the planet—but we’re also the only species that can look at those mistakes, feel genuine guilt, and fight to fix them: the suffragettes who marched for votes, the abolitionists who risked their lives, the land-back movements that are returning stolen territory to Indigenous peoples, the Paris Agreement (imperfect, but a global promise to do better), even the small act of apologizing when we hurt someone.\"\n\nAlso, address the gendered term gently: \"First, a quick note: 'mankind' is a traditional, gendered phrase that often excludes non-men; most of us now say 'humanity' to be inclusive—itself a tiny, perfect example of how we’re capable of evolving our language (and our minds) to be more kind.\"\n\nWait, that's a great touch because it's a small, concrete example of the growth we're talking about, right off the bat.\n\nLet me also make sure the closing is grounded, not naive. Like: \"None of this erases the harm we’ve done, or the work we still need to do. Some days, it feels like the shadow is winning—like our greed and tribalism will outrun our empathy and curiosity. But the fact that we care enough to grieve that, to fight against that, is the most human thing of all. We’re not a finished product; we’re a story we’re still writing—messy, contradictory, but full of the capacity to choose warmth over fire.\"\n\nYes, that's good. Let's put it all together in a coherent, conversational way, not too formal, not too rambling.",
"role": "assistant"
}
}
],
"created": 1777553611,
"id": "0217775535733357e031431b40d2024cf18919c414bfdfad36498",
"model": "seed-2-0-code-preview-260328",
"service_tier": "default",
"object": "chat.completion",
"usage": {
"completion_tokens": 2962,
"prompt_tokens": 39,
"total_tokens": 3001,
"prompt_tokens_details": {
"cached_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 2157
}
},
"meta": {
"usage": {
"credits_used": 23155,
"usd_spent": 0.0115775
}
}
}