> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gmproxys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Criar Proxy

> Cria um novo usuário da proxy datacenter ou residencial.

Cria um novo usuário da proxy com os parâmetros de tipo, threads e localização desejados.

## Headers

<ParamField header="X-API-Key" type="string" required>
  Sua chave de API no formato `gm_SUA_CHAVE`.
</ParamField>

## Body

<ParamField body="type" type="string" required>
  Tipo do proxy. Valores aceitos: `datacenter` ou `residential`.
</ParamField>

<ParamField body="balance" type="integer" required>
  Saldo inicial (em bytes) a ser creditado ao novo usuário da proxy.
</ParamField>

<ParamField body="threads" type="integer" required>
  Quantidade de threads simultâneas.

  * Mínimo: `1000`
  * Máximo: `3000`
</ParamField>

<ParamField body="country" type="string" required>
  Código ou nome do país de destino do proxy.
</ParamField>

<ParamField body="state" type="string">
  Estado dentro do país selecionado.
</ParamField>

<ParamField body="city" type="string">
  Cidade dentro do país selecionado.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.gmproxys.com/v1/proxy \
    -H "X-API-Key: gm_SUA_CHAVE" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "residential",
      "threads": 1500,
      "country": "BR",
      "state": "saopaulo",
      "city": "saopaulo",
      "balance": 10737418240
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.gmproxys.com/v1/proxy", {
    method: "POST",
    headers: {
      "X-API-Key": "gm_SUA_CHAVE",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      type: "residential",
      threads: 1500,
      country: "BR",
      state: "saopaulo",
      city: "saopaulo",
      balance: 10737418240,
    }),
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.gmproxys.com/v1/proxy",
      headers={
          "X-API-Key": "gm_SUA_CHAVE",
          "Content-Type": "application/json",
      },
      json={
          "type": "residential",
          "threads": 1500,
          "country": "BR",
          "state": "saopaulo",
          "city": "saopaulo",
          "balance": 10737418240,
      },
  )

  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": 7382,
    "login": "82364cb158467f5e5a64",
    "password": "ba4d43e7b0ee471c",
    "balance": 0,
    "balance_format": 0,
    "threads": 100,
    "allowed_ips": [],
    "blocked": false,
    "type": "residential",
    "default_pool_parameters": {
      "countries": ["us"],
      "cities": ["newyork", "chicago"],
      "states": [],
      "exclude_countries": []
    },
    "blocked_hosts": []
  }
  ```

  ```json 401 Token inválido theme={null}
  {
    "success": false,
    "message": "Invalid API token."
  }
  ```

  ```json 402 Saldo insuficiente theme={null}
  {
    "success": false,
    "message": "Insufficient balance."
  }
  ```
</ResponseExample>

<Note>
  O valor de `threads` deve estar entre **1000** e **3000**. Requisições fora desse intervalo serão rejeitadas.
</Note>
