# Auto Code — Use via Hanzo AI API

> Auto Code is OpenRouter’s router built specifically for coding agents and h... Call via Hanzo's OpenAI-compatible API. Context: 2M.

[Models](https://hanzo.ai/models)/[OpenRouter](https://hanzo.ai/models/openrouter)/auto-code

OpenRouter

# Auto Code

Auto Code is OpenRouter’s router built specifically for coding agents and harnesses.

[Get API key](https://platform.hanzo.ai/api-keys)[Try in Chat](https://hanzo.ai/chat)

## Specifications

Context Window2M

Modalitiestext, image

Price…

Model IDopenrouter/auto-code

## Quick start

[Get an API key →](https://platform.hanzo.ai/api-keys)

TypeScript

Python

cURL

Go

TypeScript

```
import OpenAI from 'openai' const client = new OpenAI({ apiKey: process.env.HANZO_API_KEY, baseURL: 'https://api.hanzo.ai/v1' }) const response = await client.chat.completions.create({ model: 'openrouter/auto-code', messages: [{ role: 'user', content: 'Hello!' }] }) console.log(response.choices[0].message.content)
```

Python

```
from openai import OpenAI client = OpenAI( api_key=os.environ["HANZO_API_KEY"], base_url="https://api.hanzo.ai/v1" ) response = client.chat.completions.create( model="openrouter/auto-code", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content)
```

cURL

```
curl https://api.hanzo.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $HANZO_API_KEY" \ -d '{ "model": "openrouter/auto-code", "messages": [{"role": "user", "content": "Hello!"}] }'
```

Go

```
package main import ( "context" "fmt" "os" "github.com/sashabaranov/go-openai" ) func main() { cfg := openai.DefaultConfig(os.Getenv("HANZO_API_KEY")) cfg.BaseURL = "https://api.hanzo.ai/v1" client := openai.NewClientWithConfig(cfg) resp, _ := client.CreateChatCompletion(context.Background(), openai.ChatCompletionRequest{ Model: "openrouter/auto-code", Messages: []openai.ChatCompletionMessage{ {Role: openai.ChatMessageRoleUser, Content: "Hello!"}, }, }, ) fmt.Println(resp.Choices[0].Message.Content) }
```

…

## More from OpenRouter

[Auto Router2MAuto is OpenRouter’s flagship model router, built for general-purpose usage. It adapts to each request, choosing cost-optimal models and adjusting reasoning effort. It balances task difficulty, benchmark results, live prices,...](https://hanzo.ai/models/openrouter/auto)

[Auto Router (Beta)2MThe experimental version of our Auto Router where we test new improvements. Use it to get the latest and greatest version of our general purpose auto router, but expect beta...](https://hanzo.ai/models/openrouter/auto-beta)

[Body Builder (beta)128KTransform your natural language requests into structured OpenRouter API request objects. Describe what you want to accomplish with AI models, and Body Builder will construct the appropriate API calls. Example:...](https://hanzo.ai/models/openrouter/bodybuilder)

[Free Models Router200KThe simplest way to get free inference. openrouter/free is a router that selects free models at random from the models available on OpenRouter. The router smartly filters for models that...](https://hanzo.ai/models/openrouter/free)

[Fusion1MFusion turns your prompt into a small multi-model deliberation. A panel of expert models (see below) analyzes your prompt in parallel with web search and web fetch enabled, then a...](https://hanzo.ai/models/openrouter/fusion)

[Pareto Code Router2MThe Pareto Router maintains a tiered shortlist of strong coding models, ranked by [Artificial Analysis](https://artificialanalysis.ai/) coding percentiles. Set min_coding_score between 0 and 1 on the [pareto-router plugin](https://openrouter.ai/docs/guides/routing/routers/pareto-router#the-min_coding_score-parameter) to control how...](https://hanzo.ai/models/openrouter/pareto-code)

[View all OpenRouter models →](https://hanzo.ai/models/openrouter)

## Use Auto Code via Hanzo AI

One API key. Every major model. OpenAI-compatible. Start free.

[Get an API key](https://platform.hanzo.ai/api-keys)[Browse All Models](https://hanzo.ai/models)
