> 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 full documentation content, see https://developers.meshapi.ai/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.meshapi.ai/_mcp/server.

# Batches

> Process large workloads with the Go SDK.

# Batches

Process thousands of requests asynchronously.

## 1. Create a Batch

```go
batch, err := client.Batches.Create(ctx, meshapi.CreateBatchParams{
    Requests: []meshapi.BatchRequestItem{
        {
            CustomID: "req-1",
            Body: map[string]interface{}{
                "model": "openai/gpt-4o-mini",
                "messages": []map[string]string{
                    {"role": "user", "content": "Say hi."},
                },
            },
        },
    },
    CompletionWindow: "24h",
})
```

## 2. Monitor and Retrieve

```go
// Get status
status, _ := client.Batches.Get(ctx, batch.ID)

// Download results once status is "completed"
if status.Status == "completed" {
    results, _ := client.Files.Content(ctx, *status.OutputFileID)
    // process results
}
```