DevHub BrasilDOCUMENTATION
ConsoleAPI reference ↗
EN

Prices are shown in Brazilian reais (BRL). Checkout is currently available in Brazil via PIX or card.

FROM SETUP TO YOUR FIRST RESPONSE

Connect DevHub to your workflow.

The easiest way is DevHub Chat. With an active pass, you do not need to choose a key. To use the Gateway and your tools, create a key under API keys. New keys are encrypted and can be viewed again. Older keys stored only as hashes remain valid but cannot be retrieved.

Create a key in the console, choose a model from the catalog, and configure your tool. For OpenAI-compatible clients, use https://api.devhubbrasil.com/v1. For Claude Code, use the root URL https://api.devhubbrasil.com.

The three connection settings

Field Example value
Base URL · OpenAI https://api.devhubbrasil.com/v1
API key dh_SUA_CHAVE
Model ID O exact ID mostrado in the catalog do console
  1. Open the console and go to API keys. Create a key with inference e models:read.
  2. Copy and securely save the full key. New keys can be viewed again with “View key”; older keys stored only as hashes cannot be retrieved.
  3. Abra DevHub Chat. Choose Automatic or a model, then make a short request.
  4. Check the response, usage, and balance before configuring a tool that makes many requests.

O modelo devhub-echo, when enabled, is for integration testing and returns simulated text. For real AI, choose a model from a provider configured in the catalog.

CATALOG AND ROUTING

Which Model ID should I use?

Use the exact ID shown in the Model Catalog or in GET /v1/models. The name shown in the selector is the human-readable label; the Model ID is the value to send in the model field. Examples that may appear in the catalog: claude-sonnet-5, claude-fable-5.1 e gpt-5.5. Your console catalog is the current reference; names and availability may change.

The ID selects an entry in the DevHub catalog. The Gateway chooses which configured provider handles the request and may use a fallback route. The catalog name alone, . does not prove that the request was handled by the official API of the company named by the model. A DevHub API key is also not an official Claude, ChatGPT, or other app subscription.

Features depend on the model and route: text, images, audio, tools, and context support can vary. Check the capabilities shown in the catalog and run a small test before using files or long workflows.

Check available IDs

curl https://api.devhubbrasil.com/v1/models \
  -H "Authorization: Bearer dh_SUA_CHAVE"
APP · WINDOWS

Install the Gateway on Windows

  1. Open the DevHub homepage and download the Windows Gateway installer. Check the version shown on the download button.
  2. Open the downloaded file and follow the installer steps. If Windows displays a warning, check the file source and signature. If you cannot verify the publisher, do not bypass the block; contact support.
  3. Open the Gateway, connect with a key created under API keys and choose a Model ID available in the catalog.
  4. Send a short prompt. If the connection fails, check the base URL shown in the Gateway, the key, your active pass, and the Model ID. Do not paste the key into chats, screenshots, or public support tickets.

The Gateway installer is for Windows. On macOS, follow the API/Claude Code tutorial below; on Linux, choose the package that matches your distribution and architecture. Always use the version shown on the downloads page.

VISUAL STUDIO CODE

Cline

  1. Open the Cline extension in VS Code and go to its settings.
  2. Em API Provider, selecione OpenAI Compatible.
  3. Enter the Base URL ending in /v1 e sua chave dh_....
  4. Set Model ID to the model ID shown in the DevHub catalog.
  5. If the extension asks for a context window or output limit, use values supported by the model. Start with a small task and check usage.

Enable features such as images or tools only for models that support them. Agent workflows also depend on model behavior and the extension version.

VISUAL STUDIO CODE

Continue

In Continue's YAML configuration, add a model with provider: openai e sua URL em apiBase. The Gateway exposes Chat Completions; set useResponsesApi: false quando necessário.

name: DevHub AI
version: 1.0.0
schema: v1
models:
  - name: Meu modelo DevHub
    provider: openai
    model: ID_DO_MODELO
    apiBase: https://api.devhubbrasil.com/v1
    apiKey: dh_SUA_CHAVE
    useResponsesApi: false

Save this configuration in a private local file or use your version of Continue's secret manager. Never commit the key to a repository.

EDITOR

Cursor

  1. Em Settings → Models, procure as opções de chaves de API próprias.
  2. Se sua versão oferecer Override OpenAI Base URL, habilite e informe https://api.devhubbrasil.com/v1.
  3. Set your DevHub key in the OpenAI connection and enable it.
  4. Select or add a Model ID that exactly matches the Gateway catalog.
  5. Send a short chat message and check that the request appears in your DevHub history.

Custom Base URL and API-key features depend on your Cursor version and plan. Cursor-native features, models using other protocols, and Tab Completion may use Cursor infrastructure. This connection does not replace your Cursor subscription or guarantee support for every model or feature.

TERMINAL · EXPERIMENTAL COMPATIBILITY

Claude Code

Claude Code uses the Anthropic protocol. DevHub exposes /v1/messages; configure a URL raiz, pois o cliente acrescenta /v1/messages. Não acrescente /v1 à variável abaixo.

PowerShell:

$env:ANTHROPIC_BASE_URL="https://api.devhubbrasil.com"
$env:ANTHROPIC_AUTH_TOKEN="dh_SUA_CHAVE"
$env:ANTHROPIC_MODEL="ID_DO_MODELO"
claude

macOS / Linux:

export ANTHROPIC_BASE_URL="https://api.devhubbrasil.com"
export ANTHROPIC_AUTH_TOKEN="dh_SUA_CHAVE"
export ANTHROPIC_MODEL="ID_DO_MODELO"
claude

Anthropic compatibility in this installation is experimental. It supports text, streaming, and tool-call translation for models that support those features. Token counting returns a local estimate. Thinking, native server tools, documents/PDFs, and advanced prompt caching are not implemented. This setup does not certify that every agent feature works. Anthropic does not support using Claude Code with non-Claude models.

Use a dedicated key for this client and test reading, editing, and execution in a disposable project before relying on it for real work.

TUTORIAL · MACOS

Use the DevHub API on Mac

This tutorial configures the Claude Code CLI on macOS to send requests to the DevHub API. At this time, this documentation does not offer a macOS installer for the Gateway app; connect from the Mac terminal.

  1. Open console DevHub, crie one key de API com permissão de inferência e guarde-a em local privado. Não a envie por mensagem ou captura de tela.
  2. Open Terminal. Install Claude Code using Anthropic's official installer, then verify the installation:
curl -fsSL https://claude.ai/install.sh | bash
claude --version

Para testar primeiro nesta janela do Terminal, configure a URL raiz (sem /v1) e a chave. Depois inicie o Claude Code:

export ANTHROPIC_BASE_URL="https://api.devhubbrasil.com"
export ANTHROPIC_AUTH_TOKEN="dh_SUA_CHAVE"
claude

Dentro do Claude Code, rode /status e confirme que a URL base mostra https://api.devhubbrasil.com. Choose um Model ID que apareça in the catalog DevHub e teste uma pergunta curta. As variáveis acima valem para essa janela do Terminal.

Para manter a conexão em novas janelas, crie a pasta e abra o arquivo pessoal de configurações:

mkdir -p ~/.claude
nano ~/.claude/settings.json

Coloque este conteúdo no arquivo, substituindo dh_SUA_CHAVE pela sua chave privada:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.devhubbrasil.com",
    "ANTHROPIC_AUTH_TOKEN": "dh_SUA_CHAVE"
  }
}

Salve e feche o editor, depois proteja a chave: chmod 600 ~/.claude/settings.json. Evite salvar a chave em arquivos do projeto ou repositórios. Se usar a extensão do VS Code, configure também as variáveis nas configurações de ambiente da extensão; ela pode não herdar valores do Terminal.

Anthropic integration with Claude Code is experimental. Text, streaming, and some tools may work; features that rely on protocol-specific extensions may be unavailable. Anthropic does not support using non-Claude models. If something fails, check /status, a chave/permissão in the console e o exact ID do modelo.

TUTORIAL · LINUX

Install and open Gateway on Linux

The site provides the Linux Gateway for amd64/x86-64. On Ubuntu/Debian, use the .deb, which installs system dependencies. Download it from the homepage and check that the version in the filename matches the version shown on the download button. Open Terminal in your Downloads folder:

cd ~/Downloads
sudo apt update
sudo apt install ./DevHub-Brasil-Gateway-VERSAO-linux.deb

Then open DevHub Brasil Gateway from the applications menu. On first use, connect with your DevHub key and select a model from the catalog. You can start the AppImage version with:

chmod +x ~/Downloads/DevHub-Brasil-Gateway-VERSAO-linux.AppImage
~/Downloads/DevHub-Brasil-Gateway-VERSAO-linux.AppImage

Replace VERSAO with the number shown in the downloaded filename. On Ubuntu/Debian, the command below also works from your Downloads folder:

sudo apt install ./NOME_EXATO_DO_ARQUIVO.deb

Se o sistema disser “dependência não satisfeita”, atualize a lista com sudo apt update e repita sudo apt install ./arquivo.deb; não use dpkg -i sozinho, pois ele não baixa dependências automaticamente. Se o aplicativo não abrir, envie ao suporte a distribuição/versão do Linux e a mensagem completa do Terminal. O pacote é para sistemas x86-64, não ARM.

SEU APLICATIVO

SDK OpenAI e HTTP

Use Chat Completions com a Base URL DevHub. Mantenha a chave no servidor ou em variáveis de ambiente de uma aplicação local.

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["DEVHUB_API_KEY"],
    base_url="https://api.devhubbrasil.com/v1",
)
response = client.chat.completions.create(
    model="ID_DO_MODELO",
    messages=[{"role": "user", "content": "Olá"}],
    max_tokens=512,
)
print(response.choices[0].message.content)

Streaming:

stream = client.chat.completions.create(
    model="ID_DO_MODELO",
    messages=[{"role": "user", "content": "Olá"}],
    max_tokens=512,
    stream=True,
    stream_options={"include_usage": True},
)
for chunk in stream:
    if chunk.choices:
        print(chunk.choices[0].delta.content or "", end="")

cURL (macOS/Linux; troque curl por curl.exe no Windows e adapte a continuação de linhas ao seu terminal):

curl https://api.devhubbrasil.com/v1/models \
  -H "Authorization: Bearer $DEVHUB_API_KEY"

curl https://api.devhubbrasil.com/v1/chat/completions \
  -H "Authorization: Bearer $DEVHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"ID_DO_MODELO","messages":[{"role":"user","content":"Olá"}],"max_tokens":512,"stream":true}'

PowerShell, sem depender do escape de aspas do cURL:

$body = @{
  model = "ID_DO_MODELO"
  messages = @(@{ role = "user"; content = "Olá" })
  max_tokens = 512
} | ConvertTo-Json -Depth 10

Invoke-RestMethod -Method Post `
  -Uri "https://api.devhubbrasil.com/v1/chat/completions" `
  -Headers @{ Authorization = "Bearer $env:DEVHUB_API_KEY" } `
  -ContentType "application/json" -Body $body

The Gateway also provides POST /v1/responses in partial compatibility mode: text input, a basic response, and limited tool conversion. This adapter does not preserve images sent through this route and is not equivalent to the full OpenAI Responses API. POST /v1/messages/count_tokens returns a local estimate, not a native provider token count. Embeddings and dedicated audio/image endpoints are not covered in this reference. Tool support and output formats depend on the model and configured adapter.

Abrir a referência dos endpoints ↗
CONTROLE DE USO

Passes, limites e respostas de erro

O active pass dá acesso à API durante o período contratado, dentro do teto diário de tokens do passe. Ao atingir o teto diário, a API responde 429 e o uso volta no dia seguinte. Não há janela de 5 horas nem limite semanal. O gateway mede o uso para segurança e operação. Continuam valendo os technical limits de taxa/contexto, disponibilidade e políticas dos providers.

Código O que verificar
400 / 422 Campos, conteúdo e parâmetros da chamada.
401 / 403 Chave válida, permissões e situação da conta.
402 Passe ativo ou saldo legado disponível.
404 URL do endpoint e Model ID do catálogo.
429 Request limit; follow the Retry-After header.
502 / 503 Service or provider availability. Wait and retry with increasing intervals.

Guarde o X-Request-ID retornado para localizar a chamada no histórico. Interromper streaming pode gerar consumo pelos tokens já processados. Um modelo simulado não valida os recursos de um provedor real.

Boas práticas para suas chaves

  • Use one key per project or tool and grant only the permissions it needs.
  • Do not put keys in public websites, screenshots, logs, or repositories.
  • Rotate an exposed key and update your configuration. The old key stops working immediately.
  • Use HTTPS in production and check your history if you have questions about usage.

Pagamento e liberação automática

Choose um passe in the console e conclua o pagamento pelo meio disponível. The pass é ativado automaticamente assim que o provedor confirma o pagamento. Enquanto o pedido aparecer como pendente ou em revisão, a confirmação ainda não chegou; atualize o status e não faça outro pagamento para o mesmo pedido.

REFERÊNCIA DA API

API OpenAI-compatible e Gateway Anthropic

Usene key de API DevHub com permissão de inferência. The pass precisa estar ativo. Envie a chave no header indicado abaixo; não exponha chaves no código de páginas públicas.

Acesso por active pass: o uso é limitado pelo teto diário de tokens do passe (o valor de cada passe está em /precos e in the console). Ao atingir o teto, a API responde 429 e o uso volta no dia seguinte. Passe ativo e chave válida continuam obrigatórios. Context window e saída máxima por chamada, limites de taxa, disponibilidade e políticas do provedor continuam aplicáveis.

MétodoEndpointUso
GET/v1/modelsConsultar modelos disponíveis para a sua chave
POST/v1/chat/completionsConversas no formato OpenAI, com streaming opcional
POST/v1/messagesGateway no formato Anthropic
POST/v1/messages/count_tokensEstimativa local de tokens de entrada
POST/v1/responsesCompatibilidade parcial com a API Responses

Chat Completions

curl https://api.devhubbrasil.com/v1/chat/completions \
  -H "Authorization: Bearer dh_SUA_CHAVE" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-5","messages":[{"role":"user","content":"Olá!"}],"max_tokens":512,"stream":false}'

A resposta segue o formato choices[0].message.content. Com stream: true, leia os eventos SSE data: até [DONE].

Anthropic Messages

curl https://api.devhubbrasil.com/v1/messages \
  -H "x-api-key: dh_SUA_CHAVE" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-5","max_tokens":512,"messages":[{"role":"user","content":"Olá!"}]}'

Erros e limites

401: confira a chave. 403: confira permissões e acesso. 429: limite técnico, aguarde a janela indicada. 502/503: falha ou indisponibilidade temporária do upstream. See as seções de integração e erros para detalhes.

Esta é a referência pública de integração. O Swagger interno não é exposto em produção. Todas as chamadas e limites continuam nas rotas existentes.

Não encontrou? Chama — 61 99823-9879