---
title: "Documentação API e CLI: Node, Python, Go e PHP | SingleFax"
description: "Envie fax do seu backend com a API REST e CLI npm do SingleFax. Créditos pré-pagos, chaves de API, OpenAPI e exemplos curl, Node, Python, Go e PHP."
canonical_url: "https://singlefax.com/pt-br/desenvolvedores"
meta:
  "og:description": "Envie fax do seu backend com a API REST e CLI npm do SingleFax. Créditos pré-pagos, chaves de API, OpenAPI e exemplos curl, Node, Python, Go e PHP."
  "og:image": "https://singlefax.com/_og/s/o_b2f169c24bffbb0d.jpeg"
  "og:image:alt": "Documentação API e CLI: Node, Python, Go e PHP"
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "Envie fax do seu backend"
---

> Index of every page on this site: [llms.txt](https://singlefax.com/llms.txt)

[singlefax](https://singlefax.com/pt-br)

[Enviar e receber](https://singlefax.com/pt-br/enviar-fax) [Para empresas](https://singlefax.com/pt-br/para-empresas)Soluções [Preços](https://singlefax.com/pt-br/precos) [Blog](https://singlefax.com/pt-br/blog)

<details>

<summary>Idioma</summary>



<a href="https://singlefax.com/developers">English</a><a href="https://singlefax.com/de/entwickler">Deutsch</a><a href="https://singlefax.com/fr/developpeurs">Français</a><a href="https://singlefax.com/es/desarrolladores">Español</a><a href="https://singlefax.com/it/sviluppatori">Italiano</a><a href="https://singlefax.com/zh-tw/%E9%96%8B%E7%99%BC%E4%BA%BA%E5%93%A1">繁體中文</a><a href="https://singlefax.com/tr/gelistiriciler">Türkçe</a><a href="https://singlefax.com/ko/%EA%B0%9C%EB%B0%9C%EC%9E%90">한국어</a><a href="https://singlefax.com/ja/%E9%96%8B%E7%99%BA%E8%80%85%E5%90%91%E3%81%91">日本語</a><a href="https://singlefax.com/ar/%D8%A7%D9%84%D9%85%D8%B7%D9%88%D8%B1%D9%88%D9%86">العربية</a>

</details>

[Entrar](https://singlefax.com/pt-br/entrar)

REST · CLI · OpenAPI

# Documentação API e CLI do SingleFax

Chave de API e créditos pré-pagos. CLI oficial npm ou exemplos REST em curl, Node, Python, Go e PHP. Aplicativos de chat devem usar MCP.

[Criar chave de API](https://singlefax.com/pt-br/entrar?redirect=/dashboard/api-keys) [CLI npm](https://www.npmjs.com/package/@singlefax/cli) [OpenAPI](https://singlefax.com/openapi.json)

## CLI

`npx @singlefax/cli send FILE --to +E164`: envie Word, Excel, PDF ou imagem original, sem converter antes em PDF.

## REST

`POST /api/v1/faxes` com Bearer `sf_live_…` e `Idempotency-Key`.

## MCP para chat

Cursor, Claude, Codex, ChatGPT: OAuth, não chave de API. [Instalar MCP](https://singlefax.com/pt-br/agentes-ia).

## Início rápido

1. Crie uma chave com permissões limitadas em [Chaves de API](https://singlefax.com/pt-br/entrar?redirect=/dashboard/api-keys): `fax:send`, `fax:read`, `inbox:read`, `credits:read`.
2. Compre créditos no painel ou por `npx @singlefax/cli credits buy`.
3. Envie pela CLI abaixo ou por `POST /api/v1/faxes`.

URL base `https://api.singlefax.com`, mesmos caminhos em `https://singlefax.com`. Chaves `sf_test_` não enviam faxes reais. Não coloque chaves no navegador.

## CLI

Node 20 ou superior. Configuração: `SINGLEFAX_API_KEY` ou `~/.config/singlefax/config.json`. Envie Word, Excel, PowerPoint, PDF, texto ou imagem original; não converta antes. Não serve para MCP OAuth ou Stripe MPP.

terminalCopiar

```
export SINGLEFAX_API_KEY=sf_live_…

npx @singlefax/cli send ./document.docx --to +14155552671
npx @singlefax/cli send ./document.pdf --to +14155552671 --wait --json
```

quote, status, creditsCopiar

```
npx @singlefax/cli quote --to +14155552671 --pages 12
npx @singlefax/cli status <id>
npx @singlefax/cli list
npx @singlefax/cli numbers
npx @singlefax/cli numbers buy
npx @singlefax/cli credits
npx @singlefax/cli credits buy --dollars 20
```

## Enviar um fax

Uma solicitação: documento em base64 e destino. PDF, Word, Excel, PowerPoint, texto ou imagens. `Idempotency-Key` é obrigatório. Reusar uma chave com corpo diferente retorna 409.

curlJavaScriptPythonGoPHP

terminalCopiar

```
PDF_B64="$(base64 < document.pdf | tr -d '\n')"

curl -sS https://api.singlefax.com/api/v1/faxes \
  -H "Authorization: Bearer $SINGLEFAX_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d "{\"to\":\"+14155552671\",\"base64\":\"$PDF_B64\"}"
```

send.mjsCopiar

```
import { readFile } from 'node:fs/promises'
import { randomUUID } from 'node:crypto'

const api = 'https://api.singlefax.com'
const key = process.env.SINGLEFAX_API_KEY
const pdf = await readFile('./document.pdf')

const res = await fetch(`${api}/api/v1/faxes`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${key}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': randomUUID(),
  },
  body: JSON.stringify({
    to: '+14155552671',
    base64: pdf.toString('base64'),
  }),
})
console.log(await res.json())
```

send.pyCopiar

```
import base64, json, os, urllib.request, uuid
from pathlib import Path

API = "https://api.singlefax.com"
KEY = os.environ["SINGLEFAX_API_KEY"]
pdf = Path("document.pdf").read_bytes()

req = urllib.request.Request(
    f"{API}/api/v1/faxes",
    data=json.dumps({
        "to": "+14155552671",
        "base64": base64.b64encode(pdf).decode(),
    }).encode(),
    headers={
        "Authorization": f"Bearer {KEY}",
        "Content-Type": "application/json",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    method="POST",
)
with urllib.request.urlopen(req) as res:
    print(res.read().decode())
```

send.goCopiar

```
package main

import (
	"bytes"
	"encoding/base64"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	pdf, err := os.ReadFile("document.pdf")
	if err != nil {
		panic(err)
	}
	body, _ := json.Marshal(map[string]string{
		"to":     "+14155552671",
		"base64": base64.StdEncoding.EncodeToString(pdf),
	})
	req, _ := http.NewRequest("POST", "https://api.singlefax.com/api/v1/faxes", bytes.NewReader(body))
	req.Header.Set("Authorization", "Bearer "+os.Getenv("SINGLEFAX_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Idempotency-Key", "send-document-1")
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(res.Status, string(out))
}
```

send.phpCopiar

```
<?php
$pdf = base64_encode(file_get_contents('document.pdf'));
$ch = curl_init('https://api.singlefax.com/api/v1/faxes');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer ' . getenv('SINGLEFAX_API_KEY'),
    'Content-Type: application/json',
    'Idempotency-Key: send-document-1',
  ],
  CURLOPT_POSTFIELDS => json_encode(['to' => '+14155552671', 'base64' => $pdf]),
  CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);
```

## Arquivos maiores: envie o arquivo e depois o fax

A CLI cria um token de upload, envia os bytes por PUT e transmite com `uploadToken`. PUT também exige Bearer. É melhor do que incluir arquivo grande em JSON. Não converta antes em PDF.

curlJavaScriptPythonGoPHP

terminalCopiar

```
UPLOAD=$(curl -sS https://api.singlefax.com/api/v1/uploads \
  -H "Authorization: Bearer $SINGLEFAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType":"application/pdf"}')

UPLOAD_URL=$(printf '%s' "$UPLOAD" | python3 -c "import json,sys; print(json.load(sys.stdin)['uploadUrl'])")
TOKEN=$(printf '%s' "$UPLOAD" | python3 -c "import json,sys; print(json.load(sys.stdin)['uploadToken'])")

curl -sS -X PUT "$UPLOAD_URL" \
  -H "Authorization: Bearer $SINGLEFAX_API_KEY" \
  -H "Content-Type: application/pdf" \
  --data-binary @document.pdf

curl -sS https://api.singlefax.com/api/v1/faxes \
  -H "Authorization: Bearer $SINGLEFAX_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d "{\"to\":\"+14155552671\",\"uploadToken\":\"$TOKEN\"}"
```

upload-send.mjsCopiar

```
import { readFile } from 'node:fs/promises'
import { randomUUID } from 'node:crypto'

const api = 'https://api.singlefax.com'
const key = process.env.SINGLEFAX_API_KEY
const auth = { Authorization: `Bearer ${key}` }
const pdf = await readFile('./document.pdf')

const upload = await fetch(`${api}/api/v1/uploads`, {
  method: 'POST',
  headers: { ...auth, 'Content-Type': 'application/json' },
  body: JSON.stringify({ contentType: 'application/pdf', maxBytes: pdf.byteLength }),
}).then((r) => r.json())

await fetch(upload.uploadUrl, {
  method: 'PUT',
  headers: { ...auth, 'Content-Type': 'application/pdf' },
  body: pdf,
})

const fax = await fetch(`${api}/api/v1/faxes`, {
  method: 'POST',
  headers: {
    ...auth,
    'Content-Type': 'application/json',
    'Idempotency-Key': randomUUID(),
  },
  body: JSON.stringify({ to: '+14155552671', uploadToken: upload.uploadToken }),
}).then((r) => r.json())

console.log(fax)
```

upload\_send.pyCopiar

```
import json, os, urllib.request, uuid
from pathlib import Path

API = "https://api.singlefax.com"
KEY = os.environ["SINGLEFAX_API_KEY"]
pdf = Path("document.pdf").read_bytes()

def request(url, *, data=None, method="GET", headers=None, content_type="application/json"):
    req = urllib.request.Request(
        url,
        data=data,
        headers={
            "Authorization": f"Bearer {KEY}",
            "Content-Type": content_type,
            **(headers or {}),
        },
        method=method,
    )
    with urllib.request.urlopen(req) as res:
        return res.read()

upload = json.loads(request(
    f"{API}/api/v1/uploads",
    method="POST",
    data=json.dumps({"contentType": "application/pdf", "maxBytes": len(pdf)}).encode(),
))
request(upload["uploadUrl"], method="PUT", data=pdf, content_type="application/pdf")
fax = request(
    f"{API}/api/v1/faxes",
    method="POST",
    data=json.dumps({"to": "+14155552671", "uploadToken": upload["uploadToken"]}).encode(),
    headers={"Idempotency-Key": str(uuid.uuid4())},
)
print(fax.decode())
```

upload\_send.goCopiar

```
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	key := os.Getenv("SINGLEFAX_API_KEY")
	pdf, err := os.ReadFile("document.pdf")
	if err != nil {
		panic(err)
	}

	upBody, _ := json.Marshal(map[string]any{"contentType": "application/pdf", "maxBytes": len(pdf)})
	upReq, _ := http.NewRequest("POST", "https://api.singlefax.com/api/v1/uploads", bytes.NewReader(upBody))
	upReq.Header.Set("Authorization", "Bearer "+key)
	upReq.Header.Set("Content-Type", "application/json")
	upRes, err := http.DefaultClient.Do(upReq)
	if err != nil {
		panic(err)
	}
	defer upRes.Body.Close()
	var upload struct {
		UploadToken string `json:"uploadToken"`
		UploadUrl   string `json:"uploadUrl"`
	}
	json.NewDecoder(upRes.Body).Decode(&upload)

	put, _ := http.NewRequest("PUT", upload.UploadUrl, bytes.NewReader(pdf))
	put.Header.Set("Authorization", "Bearer "+key)
	put.Header.Set("Content-Type", "application/pdf")
	if _, err := http.DefaultClient.Do(put); err != nil {
		panic(err)
	}

	sendBody, _ := json.Marshal(map[string]string{"to": "+14155552671", "uploadToken": upload.UploadToken})
	faxReq, _ := http.NewRequest("POST", "https://api.singlefax.com/api/v1/faxes", bytes.NewReader(sendBody))
	faxReq.Header.Set("Authorization", "Bearer "+key)
	faxReq.Header.Set("Content-Type", "application/json")
	faxReq.Header.Set("Idempotency-Key", "send-document-1")
	faxRes, err := http.DefaultClient.Do(faxReq)
	if err != nil {
		panic(err)
	}
	defer faxRes.Body.Close()
	out, _ := io.ReadAll(faxRes.Body)
	fmt.Println(string(out))
}
```

upload-send.phpCopiar

```
<?php
$key = getenv('SINGLEFAX_API_KEY');
$pdf = file_get_contents('document.pdf');

$ch = curl_init('https://api.singlefax.com/api/v1/uploads');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer $key",
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => json_encode(['contentType' => 'application/pdf', 'maxBytes' => strlen($pdf)]),
  CURLOPT_RETURNTRANSFER => true,
]);
$upload = json_decode(curl_exec($ch), true);

$ch = curl_init($upload['uploadUrl']);
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer $key",
    'Content-Type: application/pdf',
  ],
  CURLOPT_POSTFIELDS => $pdf,
  CURLOPT_RETURNTRANSFER => true,
]);
curl_exec($ch);

$ch = curl_init('https://api.singlefax.com/api/v1/faxes');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer $key",
    'Content-Type: application/json',
    'Idempotency-Key: send-document-1',
  ],
  CURLOPT_POSTFIELDS => json_encode(['to' => '+14155552671', 'uploadToken' => $upload['uploadToken']]),
  CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);
```

## Referência REST

| Método | Caminho | Autenticação | Notas |
| --- | --- | --- | --- |
| POST | /api/v1/faxes | fax:send | Idempotency-Key required. JSON { to, base64 \| uploadToken } or multipart file. |
| GET | /api/v1/faxes | fax:read | List. Query limit, offset. |
| GET | /api/v1/faxes/{id} | fax:read | Status including latest delivery attempt. |
| POST | /api/v1/faxes/quote | fax:read | { to, pages? \| base64? }, quote without charging. |
| POST | /api/v1/uploads | fax:send | Returns uploadToken + uploadUrl. PUT the bytes, then send with uploadToken. |
| GET | /api/v1/credits | credits:read | Prepaid balance. |
| POST | /api/v1/credits/checkout | credits:checkout | { amountCents }. Stripe Checkout for a credit pack. |
| GET | /api/v1/received-faxes | inbox:read | Inbound inbox list. Query limit, cursor. No transcripts in list. |
| GET | /api/v1/received-faxes/{id} | inbox:read | Inbound detail with bounded transcript slice. HIPAA Secure content is omitted. |
| GET | /api/v1/numbers | fax:read | Active fax numbers. |
| POST | /api/v1/numbers | credits:checkout | { sku?, country?, state? }, default inbound\_30day. Returns checkoutUrl + reserved phoneNumber. |
| GET | /api/v1/skus | public | Catalog. Same shape as MCP list\_skus. |
| POST | /api/v1/checkout | credits:checkout | { sku }, credit\_pack, inbound, subscriptions, lifetime. |

Esquemas completos: [openapi.json](https://singlefax.com/openapi.json). Mudanças incompatíveis: [política de versões](https://singlefax.com/pt-br/versionamento), Sunset de 90 dias. HTTP 402 nesta API significa saldo insuficiente. MPP 402 só existe em `POST /api/v1/machine/faxes`.

## Webhooks

Eventos assinados `fax.queued`, `fax.delivered`, `fax.failed` e `credits.low_balance`. Verifique `SingleFax-Signature`, `t=,v1=`, com o corpo original. HMAC-SHA256 de `timestamp.payload`. Adicione o endpoint em [webhooks do painel](https://singlefax.com/pt-br/entrar?redirect=/dashboard/webhooks).

JavaScriptPython

verify.mjsCopiar

```
import { createHmac, timingSafeEqual } from 'node:crypto'

export function verifySingleFaxSignature(rawBody, signatureHeader, secret, toleranceSeconds = 300) {
  const parts = Object.fromEntries(signatureHeader.split(',').map((kv) => kv.split('=')))
  const timestamp = Number(parts.t)
  if (!Number.isFinite(timestamp) || !parts.v1) return false
  if (Math.abs(Math.floor(Date.now() / 1000) - timestamp) > toleranceSeconds) return false
  const expected = createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex')
  const a = Buffer.from(parts.v1)
  const b = Buffer.from(expected)
  return a.length === b.length && timingSafeEqual(a, b)
}
```

verify.pyCopiar

```
import hashlib, hmac, time

def verify_singlefax_signature(payload: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
    parts = dict(p.split("=", 1) for p in header.split(","))
    timestamp = int(parts["t"])
    if abs(int(time.time()) - timestamp) > tolerance:
        return False
    expected = hmac.new(
        secret.encode(),
        f"{timestamp}.".encode() + payload,
        hashlib.sha256,
    ).hexdigest()
    return hmac.compare_digest(expected, parts["v1"])
```

## Restrições

- Guarde chaves de API no servidor. Não inclua `sf_live_` em uma página.
- Não envie PHI. Entidades sujeitas à HIPAA usam HIPAA Secure no site com BAA eletrônico.
- Destinos E.164 válidos. PDF, Word, Excel, PowerPoint, RTF, texto e imagens; veja MIME no OpenAPI. Não converta antes em PDF: fazemos isso antes do envio.
- MCP de chat e Stripe MPP: [/agents](https://singlefax.com/pt-br/agentes-ia), [mpp.md](https://singlefax.com/mpp.md) e [MPP ou pagamento imediato](https://singlefax.com/blog/stripe-machine-payments-protocol).

## Perguntas frequentes

CLI, REST ou MCP?

Preciso de créditos antes de enviar?

Posso usar chaves sf\_test\_?

Há SDK oficial?

É compatível com HIPAA?

## Documentação legível por máquinas

Markdown simples e OpenAPI para rastreadores e agentes de programação. Os mesmos dados desta página.

[Guia de autenticação](https://singlefax.com/pt-br/autenticacao) [Referência OpenAPI](https://singlefax.com/pt-br/openapi) [developers.md](https://singlefax.com/developers.md) [openapi.json](https://singlefax.com/openapi.json) [auth.md](https://singlefax.com/auth.md) [llms.txt](https://singlefax.com/llms.txt) [MCP e agentes](https://singlefax.com/pt-br/agentes-ia) [MPP ou pagamento imediato](https://singlefax.com/blog/stripe-machine-payments-protocol) [versioning.md](https://singlefax.com/versioning.md)

[singlefax](https://singlefax.com/pt-br)

Envie uma vez. Receba quando precisar.

[![Disponível no Google Play](https://singlefax.com/images/google-play-badge.png)](https://play.google.com/store/apps/details?id=com.monocube.singlefax) [Adicionar ao Chrome](https://chromewebstore.google.com/detail/singlefax-fax-a-document/ojpmpilgkmjcfebhpkdmmjlkbcifkkej) [SingleFax no LinkedIn](https://www.linkedin.com/company/singlefax/) [SingleFax no Facebook](https://www.facebook.com/singlefax) [SingleFax no Instagram](https://www.instagram.com/singlefax.app) [SingleFax no Threads](https://www.threads.com/@singlefax.app) [SingleFax no YouTube](https://www.youtube.com/@singlefax) [SingleFax no GitHub](https://github.com/SingleFax)

## Serviços de fax

- [Enviar um fax](https://singlefax.com/pt-br/enviar-fax?type=send)
- [Receber fax](https://singlefax.com/pt-br/enviar-fax?type=receive)
- [Número gratuito de 24 horas](https://singlefax.com/pt-br/numero-de-fax-gratis)
- [Número vitalício](https://singlefax.com/pt-br/numero-de-fax-vitalicio)
- [Portabilidade de número](https://singlefax.com/pt-br/portabilidade-numero-fax)
- [Fax de teste](https://singlefax.com/pt-br/numero-de-fax-de-teste)
- [Planos para empresas](https://singlefax.com/pt-br/para-empresas)
- [HIPAA Secure](https://singlefax.com/pt-br/fax-hipaa)
- [Fax pela internet](https://singlefax.com/pt-br/fax-pela-internet)
- [Enviar fax por e-mail](https://singlefax.com/pt-br/enviar-fax-por-email)
- [Do WhatsApp para fax](https://singlefax.com/pt-br/enviar-fax-pelo-whatsapp)

## Formulários do IRS

- [Todos os formulários do IRS](https://singlefax.com/pt-br/formularios-irs)
- [EIN · Formulário SS-4](https://singlefax.com/pt-br/obter-ein)
- [Formulário 5472](https://singlefax.com/pt-br/enviar-formulario-5472)
- [Formulário 7004](https://singlefax.com/pt-br/enviar-formulario-7004)
- [Formulário 2553](https://singlefax.com/pt-br/enviar-formulario-2553)
- [Formulário 2848](https://singlefax.com/pt-br/enviar-formulario-2848)
- [Formulário 4506-T](https://singlefax.com/pt-br/enviar-formulario-4506-t)
- [Formulário 8821](https://singlefax.com/pt-br/enviar-formulario-8821)
- [Formulário 8802](https://singlefax.com/pt-br/enviar-formulario-8802)
- [Formulário 8655](https://singlefax.com/pt-br/enviar-formulario-8655)
- [Formulário 3911](https://singlefax.com/pt-br/enviar-formulario-3911)
- [Formulário 8233](https://singlefax.com/pt-br/enviar-formulario-8233)
- [NY POA-1](https://singlefax.com/pt-br/enviar-formulario-ny-poa-1)

## Ferramentas e recursos

- [Ferramentas de fax gratuitas](https://singlefax.com/pt-br/ferramentas-fax-gratis)
- [Preparar um PDF para fax](https://singlefax.com/pt-br/preparar-fax)
- [Página de teste para impressão](https://singlefax.com/pt-br/pagina-de-teste-fax)
- [Folhas de rosto](https://singlefax.com/pt-br/folha-de-rosto-fax)
- [Aplicativo móvel](https://singlefax.com/pt-br/aplicativo-celular)
- [Extensão do Chrome](https://singlefax.com/pt-br/extensao-chrome)
- [Desenvolvedores](https://singlefax.com/pt-br/desenvolvedores)
- [Fax para agentes de IA](https://singlefax.com/pt-br/agentes-ia)
- [Versionamento](https://singlefax.com/pt-br/versionamento)
- [Diretório de fax do Congresso](https://singlefax.com/pt-br/fax/congresso)
- [Diretório de fax do Senado](https://singlefax.com/pt-br/fax/senado)
- [Diretório de fax de governadores](https://singlefax.com/pt-br/fax/governadores)

## SingleFax

- [Preços](https://singlefax.com/pt-br/precos)
- [Blog](https://singlefax.com/pt-br/blog)
- [Sobre](https://singlefax.com/pt-br/sobre)
- [Contato](https://singlefax.com/pt-br/contato)
- [Suporte](https://singlefax.com/pt-br/suporte)

© 2026 SingleFax

[Privacidade](https://singlefax.com/pt-br/politica-de-privacidade) [Termos](https://singlefax.com/pt-br/termos-de-servico) [Reembolsos](https://singlefax.com/pt-br/politica-de-reembolso) [Denunciar abuso](https://singlefax.com/pt-br/denunciar-abuso)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://singlefax.com/pt-br#website","@type":"WebSite","description":"Com o SingleFax, você envia e recebe fax avulsos pelo celular ou computador. Não precisa se cadastrar nem criar uma conta.","inLanguage":"pt-BR","name":"SingleFax – Envie e receba fax avulsos","url":"https://singlefax.com/pt-br","translationOfWork":{"@id":"https://singlefax.com/#website"}},{"@id":"https://singlefax.com/pt-br/desenvolvedores#webpage","description":"Envie fax do seu backend com a API REST e CLI npm do SingleFax. Créditos pré-pagos, chaves de API, OpenAPI e exemplos curl, Node, Python, Go e PHP.","name":"Documentação API e CLI: Node, Python, Go e PHP","url":"https://singlefax.com/pt-br/desenvolvedores","@type":["WebPage","FAQPage"],"breadcrumb":{"@id":"https://singlefax.com/pt-br/desenvolvedores#breadcrumb"},"isPartOf":{"@id":"https://singlefax.com/pt-br#website"},"mainEntity":[{"@id":"https://singlefax.com/pt-br/desenvolvedores#/schema/question/1"},{"@id":"https://singlefax.com/pt-br/desenvolvedores#/schema/question/2"},{"@id":"https://singlefax.com/pt-br/desenvolvedores#/schema/question/3"},{"@id":"https://singlefax.com/pt-br/desenvolvedores#/schema/question/4"},{"@id":"https://singlefax.com/pt-br/desenvolvedores#/schema/question/5"}],"potentialAction":[{"@type":"ReadAction","target":["https://singlefax.com/pt-br/desenvolvedores"]}]},{"@id":"https://singlefax.com/pt-br/desenvolvedores#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Início","item":"https://singlefax.com/pt-br","position":1},{"@type":"ListItem","name":"Desenvolvedores","item":"https://singlefax.com/pt-br/desenvolvedores","position":2}]},{"@id":"https://singlefax.com/pt-br/desenvolvedores#/schema/question/1","@type":"Question","inLanguage":"pt-BR","name":"CLI, REST ou MCP?","acceptedAnswer":{"@type":"Answer","text":"Use a CLI npm ou REST com chave de API e créditos pré-pagos no seu backend. Envie Word, Excel, PDF ou imagem original; não converta antes. Chats Cursor, Claude, Codex e ChatGPT usam MCP em /agents. Agentes autônomos com Stripe Shared Payment Token ou carteira Tempo USDC usam MPP, HTTP 402; veja /agents e /blog/stripe-machine-payments-protocol."}},{"@id":"https://singlefax.com/pt-br/desenvolvedores#/schema/question/2","@type":"Question","inLanguage":"pt-BR","name":"Preciso de créditos antes de enviar?","acceptedAnswer":{"@type":"Answer","text":"Sim, para envios com chave de API. Crie a chave, compre créditos no painel ou com POST /api/v1/credits/checkout e envie. HTTP 402 em /api/v1/faxes significa saldo insuficiente, não um desafio MPP."}},{"@id":"https://singlefax.com/pt-br/desenvolvedores#/schema/question/3","@type":"Question","inLanguage":"pt-BR","name":"Posso usar chaves sf_test_?","acceptedAnswer":{"@type":"Answer","text":"Chaves de teste não enviam faxes reais. Use sf_live_. Guarde as chaves no servidor; nunca inclua em navegador ou aplicativo móvel."}},{"@id":"https://singlefax.com/pt-br/desenvolvedores#/schema/question/4","@type":"Question","inLanguage":"pt-BR","name":"Há SDK oficial?","acceptedAnswer":{"@type":"Answer","text":"O pacote oficial é a CLI npm @singlefax/cli. Exemplos Python, Go e PHP usam clientes HTTP padrão. Não há SDKs separados para Python, Go ou Ruby. Use /openapi.json com ferramentas OpenAPI para gerar um cliente."}},{"@id":"https://singlefax.com/pt-br/desenvolvedores#/schema/question/5","@type":"Question","inLanguage":"pt-BR","name":"É compatível com HIPAA?","acceptedAnswer":{"@type":"Answer","text":"Não. Não envie PHI por API pública, CLI, MCP ou MPP. Entidades sujeitas à HIPAA devem usar HIPAA Secure no site com BAA eletrônico."}}]}
```