Skip to content

Code generation

Write, review and fix code with the models — and which one to use in each case.

Updated on Aug 09, 2026

The HINOW models can generate, explain, review and transform code. Start with hinow/himax when the task involves architecture, business rules or higher-risk changes. Use hinow/hicode in specialized pipelines and compare HiNova or HiGenesis for more straightforward tasks.

Start here

  • Explore — iterate on the prompt in the playground until the response has the shape you want.
  • Integrate — call POST https://api.hinow.ai/v1/chat/completions from inside your workflow: pull request review, test generation, legacy code migration.

Find the bug

The example below sends a function with an indexing error. temperature: 0 reduces variation between runs, but tests and review are still required before applying any suggestion.

curl https://api.hinow.ai/v1/chat/completions \
  -H "Authorization: Bearer $HINOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "hinow/himax",
    "temperature": 0,
    "messages": [
      {"role": "system", "content": "Você revisa código. Aponte o bug, explique em uma frase e proponha a correção mínima."},
      {"role": "user", "content": "function ultimaLinha(linhas) {\n  return linhas[linhas.length];\n}"}
    ]
  }'

The response to this call, exactly as the API returned it:

**Bug:** O índice `linhas.length` está fora dos limites do array (deveria ser `linhas.length - 1`).
**Correção:** `return linhas[linhas.length - 1];`

The response identifies the problem and proposes the minimal change. In production, validate the diff with automated tests, static analysis and the review rules of the repository.

A model just for code

For automated review, test generation and repetitive transformations, the catalog offers hinow/hicode, a model specialized in code. The current price is available in Pricing and in GET https://api.hinow.ai/v1/models:

**Bug:** O índice `linhas.length` está fora dos limites do array (deveria ser `linhas.length - 1`).

**Correção:**
```javascript
function ultimaLinha(linhas) {
  return linhas[linhas.length - 1];
}
```

Use hinow/himax when the review requires product context and architectural decisions. Consider hinow/hicode when input and output are well defined and the workflow processes code at volume.

Recipes

Pull request review

Send the diff in user and define the format of the review in system. Asking for file and line helps tie each remark to the code under analysis and makes validation easier:

system.txt
Você revisa pull requests.

Para cada problema encontrado:
- Cite o arquivo e a linha.
- Classifique: bug | risco | estilo.
- Explique em uma frase e proponha a correção mínima, como diff.

Aponte no máximo os 5 problemas mais importantes. Se não houver
problema relevante, escreva apenas "LGTM" e o motivo em uma frase.

Test generation

Send the function and describe the project structure: framework, naming convention and where the tests live. Include the edge cases that matter for the domain, such as empty values, nulls, boundaries and expected errors.

system.txt
Você escreve testes unitários em Jest.

Regras:
- Um describe por função; um it por comportamento.
- Cubra o caminho feliz e os casos de borda: entrada vazia,
  nula, no limite e inválida.
- Sem mock do que não é externo.
- Responda apenas com o arquivo de teste, completo.

Migration and codemods

Repetitive transformations — swapping an API or updating a syntax — work better with explicit input, output and acceptance criteria. hinow/higenesis is an economical option for well-bounded tasks. Return {"arquivo": ..., "codigo_novo": ...}, validate the JSON and run tests before writing the result.

Frontend

When generating interfaces, state the framework, the visual library, the accessibility requirements and states such as empty, loading, success and error. hinow/hinova is a good starting point for fast iteration; use HiMax when the task involves architecture or a broad change to the product.

Which model for code

TaskModelWhy
Architecture and refactoring with contexthinow/himaxPrioritizes capability on complex tasks
Pipelines specialized in codehinow/hicodeFocused on code generation and transformation
Iteration and assisted developmenthinow/hinovaBalances quality, speed and cost
Simple batch transformationhinow/higenesisEconomical for straightforward, repeatable tasks

Next steps