Machine-readable
OpenAPI 3.1 / Schema
Spec oficial da API em formato OpenAPI 3.1. Use para importar em ferramentas de AI, gerar SDKs automaticamente, configurar Postman/Insomnia ou alimentar qualquer agente com a definição formal da API.
JSON
openapi.json
Para ChatGPT Actions, LangChain, Postman
YAML
openapi.yaml
Para Insomnia, Bruno, geração de SDKs
TXT
llms.txt
Referência completa para LLMs e RAG
Integre em qualquer plataforma
Instruções específicas para cada ferramenta. Cole a URL do schema e comece em segundos.
ChatGPT Actions
- Abra o GPT Builder → Configure → Add Action
- Clique em Import from URL
- Cole a URL do schema JSON abaixo
- Em Authentication, selecione API Key → Header: x-api-key
Schema URL
https://cpfhub.io/openapi.json
Claude Projects
- Em Project Instructions, adicione o bloco abaixo
- O agente passa a chamar a API automaticamente ao verificar CPFs
Project Instructions
You have access to the CPFHub.io API. Spec: https://cpfhub.io/openapi.json Authentication: x-api-key header. Use getCpf to look up Brazilian CPF numbers.
Cursor / Windsurf
- Adicione a referência ao seu .cursorrules ou ao system prompt do agente
.cursorrules
# CPFHub.io API OpenAPI spec: https://cpfhub.io/openapi.json Base URL: https://api.cpfhub.io Auth header: x-api-key
n8n / Make / Zapier
- Use o nó HTTP Request com GET https://api.cpfhub.io/v1/cpf/{cpf}
- Adicione o header x-api-key com sua chave
- Ou importe o schema no módulo OpenAPI do n8n Enterprise
HTTP Request
GET https://api.cpfhub.io/v1/cpf/{{cpf}}
Headers: x-api-key: {{$credentials.cpfhub_api_key}}LangChain
- Instale langchain-community
- Carregue o spec diretamente da URL pública
Python
from langchain_community.agent_toolkits.openapi import planner
from langchain_community.utilities import TextRequestsWrapper
import yaml, requests
spec = yaml.safe_load(requests.get("https://cpfhub.io/openapi.yaml").text)
agent = planner.create_openapi_agent(
api_spec=spec,
requests_wrapper=TextRequestsWrapper(headers={"x-api-key": "SUA_API_KEY"}),
llm=llm,
)Postman / Insomnia
- Postman: Import → URL → cole a URL do schema
- Insomnia: File → Import → From URL
- Bruno: Import → OpenAPI
Import URL
https://cpfhub.io/openapi.json
Gerar SDK automaticamente
bash
npm install -g @openapitools/openapi-generator-cli # Python openapi-generator-cli generate -i https://cpfhub.io/openapi.yaml -g python -o ./cpfhub-sdk-python # TypeScript (axios) openapi-generator-cli generate -i https://cpfhub.io/openapi.yaml -g typescript-axios -o ./cpfhub-sdk-ts # Java openapi-generator-cli generate -i https://cpfhub.io/openapi.yaml -g java -o ./cpfhub-sdk-java
Spec completa (YAML)
Versão resumida para referência rápida. A spec completa com todos os schemas está em https://cpfhub.io/openapi.yaml.
openapi.yaml
openapi: 3.1.0
info:
title: CPFHub.io API
version: "1.0"
description: |
REST API for querying Brazilian CPF identity data.
Returns full name, gender, and date of birth for a given CPF number.
x-llms-txt: https://cpfhub.io/llms.txt
x-openapi-json: https://cpfhub.io/openapi.json
x-openapi-yaml: https://cpfhub.io/openapi.yaml
servers:
- url: https://api.cpfhub.io
description: Production
security:
- ApiKeyAuth: []
paths:
/v1/cpf/{cpf}:
get:
operationId: getCpf
summary: Look up a CPF
description: |
Returns identity data for the given Brazilian CPF number.
404 responses do NOT consume a credit - only 200s are billed.
parameters:
- name: cpf
in: path
required: true
schema:
type: string
example: "12345678909"
responses:
"200":
description: CPF found
content:
application/json:
example:
success: true
data:
cpf: "123.456.789-09"
name: "John Doe"
nameUpper: "JOHN DOE"
gender: "M"
birthDate: "15/06/1990"
day: 15
month: 6
year: 1990
"401": { description: Missing or invalid API Key }
"404": { description: CPF not found (no credit consumed) }
"429": { description: Rate limit exceeded }
components:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: x-api-keyMCP Server
Claude Desktop e Cursor
Agent Skills
Definições de tool para LLMs
Referência da API
Endpoint, parâmetros e erros
Atualizado em 17 de maio de 2026