> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.meshapi.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.meshapi.ai/_mcp/server.

# Batches

> Run async bulk inference jobs with the Node.js SDK.

# Batches

Submit a list of requests inline, kick off a batch, poll until done. Batch jobs run at discounted pricing. Results are returned inline in the poll response — no separate file download required.

```ts
// 1. Create the batch
const batch = await client.batches.create({
  requests: [
    {
      custom_id: "req-1",
      body: {
        model: "openai/gpt-5.4",
        messages: [{ role: "user", content: "Say hi." }],
      },
    },
    {
      custom_id: "req-2",
      body: {
        model: "openai/gpt-5.4",
        messages: [{ role: "user", content: "Say bye." }],
      },
    },
  ],
  completion_window: "24h",
});

// 2. Poll later — results are included once status is "completed"
const status = await client.batches.get(batch.id);
if (status.status === "completed") {
  for (const result of status.results ?? []) {
    console.log(result.custom_id, result.response.body.choices[0].message.content);
  }
}
```