{"openapi":"3.1.0","info":{"title":"samehand","version":"359bbfd6","description":"Texto na voz medida do autor, com o corte à vista. Índice: GET /api/."},"servers":[{"url":"https://staging.samehand.app"}],"components":{"schemas":{"Saude":{"type":"object","properties":{"ok":{"type":"boolean","description":"O Worker respondeu."},"build":{"type":"string","description":"Commit publicado. É por ele que o smoke sabe que o deploy chegou."},"exemplos":{"type":"integer","description":"Quantos textos reais há no banco de exemplos."},"modelo":{"type":"string","description":"Modelo em uso. Nome é público.","nullable":true},"protocolo":{"type":"string","description":"`openai` ou `anthropic`."}},"required":["ok","build","exemplos","modelo","protocolo"],"description":"Vivacidade e o que está configurado. A credencial nunca aparece aqui."},"StyleCard":{"type":"object","properties":{"geradoEm":{"type":"string","description":"Data em que o corpus foi medido."},"desde":{"type":"string","description":"Recorte: a partir de quando os textos entraram."},"medidas":{"allOf":[{"$ref":"#/components/schemas/MedidasPorRegistro"}],"description":"Um bloco de medidas por registro."}},"required":["geradoEm","desde","medidas"],"description":"O estilo medido do autor, para ser lido e conferido em vez de caixa-preta."},"MedidasPorRegistro":{"type":"object","properties":{"resposta":{"allOf":[{"$ref":"#/components/schemas/Medidas"}],"description":"As marcas dele quando responde alguém."},"post":{"allOf":[{"$ref":"#/components/schemas/Medidas"}],"description":"As marcas dele quando posta do zero."}},"required":["resposta","post"],"description":"As medidas separadas por registro: ele escreve diferente respondendo e postando."},"Medidas":{"type":"object","properties":{"amostras":{"type":"integer","description":"Quantos textos entraram na medida."},"palavrasMediana":{"type":"integer","description":"Mediana de palavras do registro."},"comecaMinuscula":{"type":"number","description":"Fração que começa em minúscula."},"quebraDeLinha":{"type":"number","description":"Fração com quebra de linha."},"reticencias":{"type":"number","description":"Fração com reticências."},"pergunta":{"type":"number","description":"Fração que faz pergunta."},"caps":{"type":"number","description":"Fração com CAPS de ênfase."},"semPontoFinal":{"type":"number","description":"Fração que não fecha com ponto."},"travessao":{"type":"number","description":"Fração com travessão."},"pontoEVirgula":{"type":"number","description":"Fração com ponto e vírgula."},"emoji":{"type":"number","description":"Fração com emoji."}},"required":["amostras","palavrasMediana","comecaMinuscula","quebraDeLinha","reticencias","pergunta","caps","semPontoFinal","travessao","pontoEVirgula","emoji"],"description":"As marcas do autor num registro, medidas no arquivo dele. Distribuição, não regra."},"Reescrita":{"type":"object","properties":{"registro":{"type":"string","description":"`resposta` ou `post` — muda exemplo, tom e comprimento."},"entrada":{"type":"object","description":"`{achados, palavras}` do texto que entrou."},"aviso":{"type":"string","description":"Chave de aviso, hoje só `vazio`. Nulo quando não há.","nullable":true},"variantes":{"type":"array","items":{"$ref":"#/components/schemas/Variante"},"description":"Uma por estilo ligado."},"falhas":{"type":"array","items":{"$ref":"#/components/schemas/FalhaDeEstilo"},"description":"Estilos que não voltaram."},"uso":{"type":"object","description":"`{entrada, saida, modelo}` — tokens gastos nesta reescrita."},"cota":{"type":"object","description":"`{gratis, usado, limite}` da franquia diária deste IP."}},"required":["registro","entrada","aviso","variantes","falhas","uso","cota"],"description":"A resposta de `POST /api/rewrite`: uma variante por estilo, com prova do que saiu."},"Variante":{"type":"object","properties":{"estilo":{"allOf":[{"$ref":"#/components/schemas/Estilo"}],"description":"Qual estilo gerou esta versão."},"texto":{"type":"string","description":"A reescrita. É isto que se copia."},"passou":{"type":"boolean","description":"Se o lint não achou erro nesta variante."},"achados":{"type":"array","items":{"$ref":"#/components/schemas/Achado"},"description":"O que o lint ainda encontra nela."},"palavras":{"type":"integer","description":"Quantas palavras a variante tem."},"tirado":{"type":"array","items":{"type":"string"},"description":"O que a entrada reprovava e esta variante não reprova."},"palavrasAMenos":{"type":"integer","description":"Quantas palavras a menos que a entrada."},"diff":{"allOf":[{"$ref":"#/components/schemas/Diff"}],"description":"O corte, palavra a palavra."}},"required":["estilo","texto","passou","achados","palavras","tirado","palavrasAMenos","diff"],"description":"Uma versão do texto na voz do autor, com o próprio recibo."},"Estilo":{"type":"object","properties":{"id":{"type":"string","description":"Identificador do estilo."},"nome":{"type":"string","description":"Nome de exibição, vazio quando não há estilo."}},"required":["id","nome"],"description":"O estilo de saída que gerou esta variante."},"Achado":{"type":"object","properties":{"id":{"type":"string","description":"Identificador estável: `travessao`, `vocab-llm`, `nao-so-mas`…"},"rotulo":{"type":"string","description":"Nome legível do achado."},"gravidade":{"type":"string","description":"`erro` reprova a variante; `aviso` só sinaliza."}},"required":["id","rotulo","gravidade"],"description":"Uma marca de texto de IA que o lint encontrou. Determinístico, sem modelo."},"Diff":{"type":"object","properties":{"pedacos":{"type":"array","items":{"$ref":"#/components/schemas/Pedaco"},"description":"Os trechos em ordem de leitura."},"mudou":{"type":"number","description":"Fração de palavras que mudaram, de 0 a 1."},"util":{"type":"boolean","description":"`false` quando a reescrita ficou distante demais para o corte ensinar algo."}},"required":["pedacos","mudou","util"],"description":"O corte, mostrado em vez de afirmado. Comparação por palavra, normalizada."},"Pedaco":{"type":"object","properties":{"op":{"type":"string","description":"`igual`, `saiu` (estava na entrada) ou `entrou` (é da variante)."},"texto":{"type":"string","description":"O texto do trecho, como aparece na tela."}},"required":["op","texto"],"description":"Um trecho do diff por palavra entre a entrada e a variante."},"FalhaDeEstilo":{"type":"object","properties":{"estilo":{"allOf":[{"$ref":"#/components/schemas/Estilo"}],"description":"Qual estilo falhou."},"motivo":{"type":"string","description":"Causa: erro do provedor, ou `vazio (length)`."}},"required":["estilo","motivo"],"description":"Estilo que não voltou. Aparece como falha, nunca como cartão que sumiu."},"PaymentQuota":{"type":"object","properties":{"free":{"type":"array","items":{"$ref":"#/components/schemas/PaymentFree"},"description":"Free allowances and their windows."},"paid":{"type":"array","items":{"$ref":"#/components/schemas/PaymentPrice"},"description":"List prices in USD. The operation's 402 is the payable quote."},"how_to_pay":{"type":"string","description":"Payment instructions and availability restrictions."},"live":{"type":"string","description":"Authoritative product quota endpoint.","nullable":true},"free_now":{"type":"array","items":{"type":"string"},"description":"SKUs temporarily free despite their list price."},"trial":{"allOf":[{"$ref":"#/components/schemas/PaymentTrial"}],"description":"Registration trial, when offered."}},"required":["free","paid","how_to_pay","live"]},"PaymentFree":{"type":"object","properties":{"o_que":{"type":"string","description":"Operation or allowance."},"limite":{"type":"string","description":"Allowance and eligibility."},"janela":{"type":"string","description":"Reset window, when applicable.","nullable":true}},"required":["o_que","limite","janela"]},"PaymentPrice":{"type":"object","properties":{"o_que":{"type":"string","description":"Operation and billing unit."},"price_usd":{"type":"number","description":"Current list price in USD."}},"required":["o_que","price_usd"]},"PaymentTrial":{"type":"object","properties":{"days":{"type":"integer","description":"Trial duration in days."},"how":{"type":"string","description":"Eligibility and activation steps."}},"required":["days","how"]},"PaymentX402":{"type":"object","properties":{"provider":{"type":"string","description":"Always `x402` — the only billing protocol accepted."},"mode":{"type":"string","description":"Seller mode: `live` charges for real, `dev` lets calls through unpaid."},"network":{"type":"string","description":"USDC network: `base` in production, `base-sepolia` in staging."},"chain_id":{"type":"integer","description":"EVM chain ID of the network above, so the wallet signs on the right chain."},"pay_to":{"type":"string","description":"Address that receives the payment.","nullable":true},"homolog":{"type":"boolean","description":"Staging seam on: the loop can be closed without spending USDC."},"dev":{"type":"boolean","description":"Development mode: the 402 is simulated."},"dev_gate":{"type":"boolean","description":"A homologation credential is configured; this grants no access."},"gratis":{"type":"array","items":{"type":"string"},"description":"Temporarily free SKUs."},"facilitator":{"type":"string","description":"URL of the facilitator that verifies and settles the payment."},"asset":{"type":"string","description":"Accepted currency — always `USDC`."},"asset_address":{"type":"string","description":"USDC contract on the network above."},"faucet":{"type":"string","description":"Test-USDC faucet; only on base-sepolia.","nullable":true},"wallets":{"type":"object","description":"Links to wallets that speak x402 (metamask, coinbase, base_app)."}},"required":["provider","mode","network","chain_id","pay_to","homolog","dev","dev_gate","facilitator","asset","asset_address","faucet","wallets"],"description":"x402 payment configuration in force. Comes from `planPublic` and is the same across the products."},"PaymentCredit":{"type":"object","properties":{"url":{"type":"string","description":"POST to purchase credit; GET with X-Credito to inspect its balance."},"header":{"type":"string","description":"Header for a previously issued credit token: X-Credito."}},"required":["url","header"]}},"securitySchemes":{"globalAccount":{"type":"apiKey","in":"cookie","name":"__Host-mm-auth","description":"Global session in the product's HttpOnly cookie; writes require exact Origin and X-CSRF-Token."},"contaChaveApi":{"type":"http","scheme":"bearer","bearerFormat":"mmk_…","description":"Account API key: `Authorization: Bearer mmk_…` or `X-Api-Key: mmk_…`. Created on the account page (API keys), valid only in the product where it was created; it acts as the account (or the organization that owns it)."}}},"paths":{"/api/auth/bootstrap":{"get":{"operationId":"get_api_auth_bootstrap","summary":"Prepare the browser for global sign-in.","description":"Sets a host-only HttpOnly browser cookie. CSRF is bound to the current session. No CORS.\nDevolve: { csrf, context }","responses":{"200":{"description":"{ csrf, context }","content":{"application/json":{"schema":{"type":"object","properties":{"csrf":{"type":"string","description":"X-CSRF-Token"},"context":{"type":"string","description":"Opaque view context, also in X-MM-Context; not a credential / contexto opaco da vista, não é credencial."}},"required":["csrf","context"]}}}},"400":{"description":"invalid_request"},"403":{"description":"invalid_origin / invalid_csrf"},"503":{"description":"auth_unavailable: a sessão anterior é preservada / the previous session is preserved"}},"security":[]}},"/api/account/profile":{"get":{"operationId":"get_api_account_profile","summary":"Read your global profile.","description":"Reads current preferences from the account. Edit them on your account page; products never own a separate profile.\nDevolve: {profile:{name,locale,timeZone,theme,revision}}","responses":{"200":{"description":"{profile:{name,locale,timeZone,theme,revision}}"},"401":{"description":"invalid_session"},"503":{"description":"auth_unavailable"}},"security":[{"globalAccount":[]}]}},"/api/account/avatar":{"get":{"operationId":"get_api_account_avatar","summary":"Read your global profile photo.","description":"Private WebP, up to 64 KiB, no cache. Change it on your account. No user ID or object URL accepted.\nDevolve: image/webp; Cache-Control: no-store","responses":{"200":{"description":"image/webp; Cache-Control: no-store","content":{"image/webp":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"invalid_session"},"404":{"description":"not_found: no photo / sem foto"},"503":{"description":"auth_unavailable"}},"security":[{"globalAccount":[]}]}},"/api/me":{"get":{"operationId":"get_api_me","summary":"Read the current global account in this product.","description":"Devolve: {user:{identityId,sessionId,productId,audience,authTime,methods,mfaState}}","responses":{"200":{"description":"{user:{identityId,sessionId,productId,audience,authTime,methods,mfaState}}"},"401":{"description":"invalid_session"},"503":{"description":"auth_unavailable"}},"security":[{"globalAccount":[]}]}},"/api/auth/logout":{"post":{"operationId":"post_api_auth_logout","summary":"Revoke this product session.","description":"Bootstrap/CSRF must belong to this browser and session. Other product sessions remain active.\nDevolve: { ok }","responses":{"200":{"description":"{ ok }","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","description":"true"}},"required":["ok"]}}}},"400":{"description":"invalid_request"},"403":{"description":"invalid_origin / invalid_csrf"},"503":{"description":"auth_unavailable: a sessão anterior é preservada / the previous session is preserved"}},"security":[{"globalAccount":[]}]}},"/api/account/keys":{"get":{"operationId":"get_api_account_keys","summary":"List your API keys in this product.","description":"Never returns the key itself: name, last 4 characters, organization, creation, last use (hourly) and whether it still works.\nDevolve: { keys }","responses":{"200":{"description":"{ keys }","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object"},"description":"`id`, `name`, `organizationId`, `last4`, `createdAt`, `lastUsedAt`, `revokedAt`, `active` (false when revoked or stopped by a password change / ending all sessions)."}},"required":["keys"]}}}},"401":{"description":"invalid_session"},"503":{"description":"auth_unavailable"}},"security":[{"globalAccount":[]}]}},"/api/account/keys/create":{"post":{"operationId":"post_api_account_keys_create","summary":"Create an API key for agents and scripts.","description":"Needs a sign-in in the last 5 minutes; an organization key also needs a second factor in the session and the owner/admin role with this product enabled. At most 10 live keys per account and product. The key (`secret`) is returned ONCE.\nDevolve: { key, secret }","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Up to 60 characters."},"organizationId":{"type":"string","description":"`null` for an account key."}},"required":["name","organizationId"]},"example":{"name":"agent","organizationId":null}}}},"responses":{"200":{"description":"{ key, secret }","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"object","description":"`id`, `name`, `organizationId`, `last4`, `createdAt`."},"secret":{"type":"string","description":"`mmk_…`, shown once."}},"required":["key","secret"]}}}},"400":{"description":"invalid_key_name / invalid_organization"},"401":{"description":"invalid_session / reauth_required"},"403":{"description":"invalid_origin / invalid_csrf / organization_forbidden / organization_mfa_required"},"409":{"description":"key_limit_reached"},"503":{"description":"auth_unavailable"}},"security":[{"globalAccount":[]}]}},"/api/account/keys/revoke":{"post":{"operationId":"post_api_account_keys_revoke","summary":"Revoke one of your API keys.","description":"Stops the key at once. Repeating is harmless.\nDevolve: { ok }","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The key `id`."}},"required":["id"]},"example":{"id":"…"}}}},"responses":{"200":{"description":"{ ok }","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","description":"true"}},"required":["ok"]}}}},"400":{"description":"invalid_key_id"},"401":{"description":"invalid_session"},"403":{"description":"invalid_origin / invalid_csrf"},"404":{"description":"key_not_found"},"503":{"description":"auth_unavailable"}},"security":[{"globalAccount":[]}]}},"/agent.json":{"get":{"operationId":"get_agent_json","summary":"Agent card: identity, operator, documentation, the MCP endpoint and the tools it serves. Same document as `/.well-known/agent-card.json`.","description":"Devolve: `application/json`: `name`, `provider`, `protocol` (`mcp`), `interfaces[]` and `skills[]`.","responses":{"200":{"description":"`application/json`: `name`, `provider`, `protocol` (`mcp`), `interfaces[]` and `skills[]`."}}}},"/okf/{arquivo}":{"get":{"operationId":"get_okf_by_arquivo","summary":"OKF bundle (Open Knowledge Format v0.1): markdown with frontmatter so an agent reads the whole product without parsing HTML.","description":"Devolve: `text/markdown`. Start at `/okf/index.md`, which lists the bundle.","parameters":[{"name":"arquivo","in":"path","required":true,"schema":{"type":"string"},"description":"`index.md`, `sobre.md`, `api.md` or `faq.md`.","example":"index.md"}],"responses":{"200":{"description":"`text/markdown`. Start at `/okf/index.md`, which lists the bundle."},"404":{"description":"File outside the bundle."}}}},"/.well-known/{arquivo}":{"get":{"operationId":"get_well_known_by_arquivo","summary":"Machine discovery before the home page: `api-catalog` (RFC 9727, a linkset with the API and the MCP), `security.txt` (RFC 9116), `x402` (payment manifest: network, wallet and the routes that charge) and `mcp-registry-auth` (the official MCP registry key).","description":"Devolve: `application/linkset+json` for the api-catalog; `application/json` for x402 and apis.json; `text/plain` for the other two.","parameters":[{"name":"arquivo","in":"path","required":true,"schema":{"type":"string"},"description":"`api-catalog`, `security.txt`, `x402`, `mcp-registry-auth` or `apis.json`.","example":"api-catalog"}],"responses":{"200":{"description":"`application/linkset+json` for the api-catalog; `application/json` for x402 and apis.json; `text/plain` for the other two."},"404":{"description":"Name outside the five published."}}}},"/apis.json":{"get":{"operationId":"get_apis_json","summary":"APIs.json (apisjson.org, 0.19): the index APIs.io harvests — the API, the MCP, OpenAPI, guide and OKF bundle in one file. Also at `/.well-known/apis.json`.","description":"Devolve: `application/json` in the APIs.json 0.19 format: `apis[]` with `baseURL`, `humanURL` and `properties[]`.","responses":{"200":{"description":"`application/json` in the APIs.json 0.19 format: `apis[]` with `baseURL`, `humanURL` and `properties[]`."}}}},"/api/":{"get":{"operationId":"api_index","summary":"Índice auto-descrito: cada rota, o que cobra e como plugar o MCP.","description":"Devolve: { name, description, build, base_url, docs, endpoints, mcp_tools }","responses":{"200":{"description":"{ name, description, build, base_url, docs, endpoints, mcp_tools }","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Nome do produto."},"description":{"type":"string","description":"O que o produto faz."},"build":{"type":"string","description":"Commit publicado."},"base_url":{"type":"string","description":"Origem em que esta API está servindo."},"docs":{"type":"object","description":"Links para llms.txt, OpenAPI, MCP e a UI."},"endpoints":{"type":"array","items":{"type":"object"},"description":"Catálogo de endpoints."},"mcp_tools":{"type":"array","items":{"type":"string"},"description":"Tools do MCP."}},"required":["name","description","build","base_url","docs","endpoints","mcp_tools"]}}}}}}},"/api/health":{"get":{"operationId":"get_api_health","summary":"Vivacidade, tamanho do banco de exemplos e modelo em uso.","description":"Devolve: { ok, build, exemplos, modelo, protocolo }","responses":{"200":{"description":"{ ok, build, exemplos, modelo, protocolo }","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Saude"}}}}}}},"/mcp":{"post":{"operationId":"post_mcp","summary":"MCP Streamable HTTP — as tools deste catálogo, despachadas neste mesmo Worker.","description":"Devolve: JSON-RPC 2.0 (`initialize`, `tools/list`, `tools/call`).","responses":{"200":{"description":"JSON-RPC 2.0 (`initialize`, `tools/list`, `tools/call`)."}}}},"/api/estilo":{"get":{"operationId":"voice_card","summary":"O estilo medido do autor: as marcas dele, em distribuição, com o tamanho da amostra.","description":"Devolve: { geradoEm, desde, medidas{resposta,post} }","responses":{"200":{"description":"{ geradoEm, desde, medidas{resposta,post} }","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StyleCard"}}}}}}},"/api/rewrite":{"post":{"operationId":"rewrite_in_voice","summary":"Reescreve um texto curto na voz medida do autor, mostrando o que foi cortado.","description":"Devolve: { registro, entrada, aviso, variantes[{estilo,texto,passou,achados,palavras,tirado,palavrasAMenos,diff}], falhas[{estilo,motivo}], uso, cota }","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"texto":{"type":"string","description":"O que reescrever. Texto de IA ou a ideia crua."},"contexto":{"type":"string","description":"A conversa ou o assunto. Referência, nunca respondida."},"registro":{"type":"string","description":"`resposta` (padrão) ou `post`."},"instrucoes":{"type":"string","description":"Regras do autor sobre a própria voz, uma por linha."},"estilos":{"type":"array","items":{"type":"object"},"description":"Até 5 `{id, nome, prompt}`. Cada estilo é uma variante — e uma chamada ao modelo."}}}}}},"responses":{"200":{"description":"{ registro, entrada, aviso, variantes[{estilo,texto,passou,achados,palavras,tirado,palavrasAMenos,diff}], falhas[{estilo,motivo}], uso, cota }","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reescrita"}}}},"400":{"description":"`texto_vazio` ou `json_invalido`."},"402":{"description":"Franquia do dia esgotada: pague com x402 ou crédito pré-pago."},"413":{"description":"`texto_longo` — o teto é 4000 caracteres."},"502":{"description":"`falha_upstream` — o provedor do modelo não respondeu."},"503":{"description":"`sem_credencial` — o Worker está sem modelo configurado."}}}},"/api/credito":{"post":{"operationId":"post_api_credito","summary":"Recarrega crédito pré-pago: paga uma vez com x402 e recebe o token que desconta em qualquer API da casa.","description":"Devolve: { token, saldo_usd, guarde, usar, saldo_em }","parameters":[{"name":"usd","in":"query","required":true,"schema":{"type":"integer"},"description":"Pacote: 1, 5, 10 ou 25 dólares."}],"responses":{"200":{"description":"{ token, saldo_usd, guarde, usar, saldo_em }","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"Token portador do saldo (`cred_…`). Mostrado UMA vez — não há como recuperá-lo."},"saldo_usd":{"type":"string","description":"Saldo creditado."},"guarde":{"type":"string","description":"Aviso de que o token é o portador do crédito."},"usar":{"type":"string","description":"Como apresentar o token nas rotas pagas."},"saldo_em":{"type":"string","description":"Onde consultar saldo e extrato."}},"required":["token","saldo_usd","guarde","usar","saldo_em"]}}}},"400":{"description":"Pacote fora da lista (1, 5, 10 ou 25)."},"402":{"description":"Sem pagamento — o corpo traz `accepts[]` do x402."}}},"get":{"operationId":"get_api_credito","summary":"Saldo e extrato do crédito — as últimas movimentações, sem devolver o token.","description":"Devolve: { saldo_micros, saldo_usd, criado_em, movimentos }","responses":{"200":{"description":"{ saldo_micros, saldo_usd, criado_em, movimentos }","content":{"application/json":{"schema":{"type":"object","properties":{"saldo_micros":{"type":"integer","description":"Saldo em micro-dólares (1e-6 USD)."},"saldo_usd":{"type":"string","description":"Saldo formatado."},"criado_em":{"type":"string","description":"Quando o crédito foi aberto."},"movimentos":{"type":"array","items":{"type":"object"},"description":"Entradas e saídas recentes, com produto e recurso."}},"required":["saldo_micros","saldo_usd","criado_em","movimentos"]}}}},"401":{"description":"Sem token ou token desconhecido."}}}},"/api/vitrine":{"get":{"operationId":"get_api_vitrine","summary":"The product's public numbers: traffic, agents, usage and reliability, no money.","description":"Projection published hourly by the house collector, rounded to two significant digits; `null` is a missing measurement, never zero. 15-minute cache with ETag (`If-None-Match` → 304). There is no way to send numbers through this route: publishing belongs to the collector, with its own token.\nDevolve: { v, produto, publicado, atualizado_em, stale, nome?, desde?, fuso?, hoje?, dias?, janelas?, visitantes?, pessoas?, agentes?, superficies?, mcp?, uso?, contas?, confiabilidade?, catalogo?, apoio? }","responses":{"200":{"description":"{ v, produto, publicado, atualizado_em, stale, nome?, desde?, fuso?, hoje?, dias?, janelas?, visitantes?, pessoas?, agentes?, superficies?, mcp?, uso?, contas?, confiabilidade?, catalogo?, apoio? }","content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"integer","description":"Contract version (1)."},"produto":{"type":"string","description":"Product id."},"publicado":{"type":"boolean","description":"`false` before the collector's first publication; then only these five keys come."},"atualizado_em":{"type":"string","description":"When the collector published (ISO 8601).","nullable":true},"stale":{"type":"boolean","description":"`true` when the projection is older than 26 h."},"nome":{"type":"string","description":"Product name."},"desde":{"type":"string","description":"First day the series covers.","nullable":true},"fuso":{"type":"string","description":"Time zone of the days (`UTC`)."},"hoje":{"type":"object","description":"Today: pages by class (human, AI, bot), API calls by class, machine-surface reads and product usage."},"dias":{"type":"array","items":{"type":"object"},"description":"Up to 31 days, oldest first: `dia`, `paginas`, `api`, `api_ia`, `maquina`, `visitantes`, `uso`."},"janelas":{"type":"object","description":"7- and 30-day sums (`d7`, `d30`)."},"visitantes":{"type":"object","description":"Unique visitors at the edge over 7 days."},"pessoas":{"type":"object","description":"GA4 when available: users, sessions, countries, devices and who arrived from AI.","nullable":true},"agentes":{"type":"object","description":"The AI agents and bots that read the most, 7 days."},"superficies":{"type":"object","description":"Reads of OKF, llms, well-known, OpenAPI and MCP over 7 days."},"mcp":{"type":"object","description":"MCP calls over 7 days."},"uso":{"type":"object","description":"Real product usage per resource: label, today, 7 and 30 days."},"contas":{"type":"object","description":"Users and guests.","nullable":true},"confiabilidade":{"type":"object","description":"Share of requests without 5xx over 7 days, and the live build."},"catalogo":{"type":"object","description":"Size of the catalog, when the product has one.","nullable":true},"apoio":{"type":"object","description":"Impressions and clicks per sponsor, when any."}},"required":["v","produto","publicado","atualizado_em","stale"]}}}}}}},"/api/vitrine/operador":{"get":{"operationId":"get_api_vitrine_operador","summary":"The product's full document on the operator panel — operator token only.","description":"Devolve: { produto, atualizado_em, operador }","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"`Bearer <METRICS_TOKEN>` — the operator class."}],"responses":{"200":{"description":"{ produto, atualizado_em, operador }","content":{"application/json":{"schema":{"type":"object","properties":{"produto":{"type":"string","description":"Product id."},"atualizado_em":{"type":"string","description":"When the collector published.","nullable":true},"operador":{"type":"object","description":"The collector's full document, with what the public projection leaves out.","nullable":true}},"required":["produto","atualizado_em","operador"]}}}},"401":{"description":"No token, wrong token or a token of another class."},"503":{"description":"Worker without `METRICS_TOKEN` or without the control plane."}}}},"/api/vitrine/painel":{"get":{"operationId":"get_api_vitrine_painel","summary":"The whole house panel, in the shape the gm reads — operator token only.","description":"Devolve: { apps, updated?, totals? }","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"`Bearer <METRICS_TOKEN>` — the operator class."}],"responses":{"200":{"description":"{ apps, updated?, totals? }","content":{"application/json":{"schema":{"type":"object","properties":{"apps":{"type":"array","items":{"type":"object"},"description":"One operator document per product, ordered by id."},"updated":{"type":"string","description":"When the collector closed the round."},"totals":{"type":"object","description":"House totals."}},"required":["apps"]}}}},"401":{"description":"No token, wrong token or a token of another class."},"503":{"description":"Worker without `METRICS_TOKEN` or without the control plane."}}}},"/api/vitrine/cursores":{"get":{"operationId":"get_api_vitrine_cursores","summary":"The resolved-error cursor per product (`borda`, `cli`) — operator token only.","description":"Devolve: JSON: `{ [product]: { borda?: ISO, cli?: ISO } }`; empty is `{}`.","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"`Bearer <METRICS_TOKEN>` — the operator class."}],"responses":{"200":{"description":"JSON: `{ [product]: { borda?: ISO, cli?: ISO } }`; empty is `{}`."},"401":{"description":"No token, wrong token or a token of another class."},"503":{"description":"Worker without `METRICS_TOKEN` or without the control plane."}}}},"/api/partners":{"get":{"operationId":"get_api_partners","summary":"Partnership, sponsorship and advertising: the product's placements with a suggested price, the public numbers next to them and how to propose.","description":"Information on request, no activation: placements from the house catalogue priced in USD per 30 days (90 and 365 days discounted), sponsors in effect, an excerpt of `/api/vitrine`, the house wallet (USDC on Base) and the contact path — bank deposit, PIX or invoice are arranged in the reply. Cached for 1 hour.\nDevolve: { status, produto, idioma, titulo, descricao, publico, modalidades, placements, house_bundle, parcerias, current_sponsors, stats, payment, contact, politica, _links }","responses":{"200":{"description":"{ status, produto, idioma, titulo, descricao, publico, modalidades, placements, house_bundle, parcerias, current_sponsors, stats, payment, contact, politica, _links }","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"`sob_consulta`: information and proposal, no activation and no charge."},"produto":{"type":"string","description":"Product name."},"idioma":{"type":"string","description":"Language of the texts (the product's)."},"titulo":{"type":"string","description":"Title of the offer."},"descricao":{"type":"string","description":"One sentence about the offer."},"publico":{"type":"string","description":"Who uses the product — the audience a sponsor reaches."},"modalidades":{"type":"array","items":{"type":"object"},"description":"`{ id, nome }`: patrocinio, parceria, anuncio."},"placements":{"type":"array","items":{"type":"object"},"description":"The product's placements: `id`, `nome`, `onde`, `formato`, `exclusivo`, `medicao`, `price_usd_30d` (suggested; `null` is on request), `exposure[{ dias, price_usd }]` for 30, 90 and 365 days, `disponivel`."},"house_bundle":{"type":"object","description":"The house bundle: footer and agent mention across the ten products, discounted."},"parcerias":{"type":"array","items":{"type":"string"},"description":"Partnership ideas the product is open to discuss."},"current_sponsors":{"type":"array","items":{"type":"object"},"description":"Sponsors in effect: `id`, `nome`, `url`, `frase`, `espacos`, `ate`."},"stats":{"type":"object","description":"Excerpt of the public numbers (`hoje`, `janelas`, `agentes`, `confiabilidade`) and the `link` to `/api/vitrine`; `publicado: false` before the first publication."},"payment":{"type":"object","description":"How to pay: `rede`, `chain_id`, `ativo`, `pay_to`, `eip681` (the house wallet, when declared), `alternativas` and the `nota` — bank deposit, PIX or invoice in the reply."},"contact":{"type":"object","description":"`email`, `form_url`, `api_url` (`POST /api/contact` where the handler exists), `campos` (required), `campos_proposta` (the optional proposal fields, each with its accepted values), `price_agent_usd`, `message_template`, `instructions`."},"politica":{"type":"object","description":"Placement label, refused sectors, prepayment, deadlines."},"_links":{"type":"object","description":"`self`, `stats`, `page` (`null` until the page exists), `contact`, `casa` (the same path on the ten products)."}},"required":["status","produto","idioma","titulo","descricao","publico","modalidades","placements","house_bundle","parcerias","current_sponsors","stats","payment","contact","politica","_links"]}}}}}}},"/api/metrics":{"get":{"operationId":"get_api_metrics","summary":"Uso e receita do produto, para o painel da casa. Financeiro exige token.","description":"Devolve: `{app, produto, uso, payments?}`.","responses":{"200":{"description":"`{app, produto, uso, payments?}`."},"401":{"description":"Token errado."},"503":{"description":"`METRICS_TOKEN` não configurado no Worker — o financeiro não sai sem ele."}}}},"/api/pricing":{"get":{"operationId":"pricing","summary":"Preços vigentes e franquias gratuitas.","description":"Devolve: { product, quota{free,paid,how_to_pay,live,free_now?,trial?}, pricing, billing, api_index }","responses":{"200":{"description":"{ product, quota{free,paid,how_to_pay,live,free_now?,trial?}, pricing, billing, api_index }","content":{"application/json":{"schema":{"type":"object","properties":{"product":{"type":"string","description":"Product name."},"quota":{"allOf":[{"$ref":"#/components/schemas/PaymentQuota"}],"description":"Public allowances and current list prices; not personal usage."},"pricing":{"type":"string","description":"Absolute URL of the current price list."},"billing":{"type":"string","description":"Absolute URL of payment discovery or the existing billing summary."},"api_index":{"type":"string","description":"Absolute URL of the API catalog."}},"required":["product","quota","pricing","billing","api_index"]}}}},"405":{"description":"Use GET ou HEAD."}}}},"/api/billing":{"get":{"operationId":"billing","summary":"Descoberta pública de pagamento e crédito pré-pago.","description":"Devolve: { product, quota{free,paid,how_to_pay,live,free_now?,trial?}, pricing, billing, api_index, payment{provider,mode,network,chain_id,pay_to,homolog,dev,dev_gate,gratis?,facilitator,asset,asset_address,faucet,wallets}, credit{url,header} }","responses":{"200":{"description":"{ product, quota{free,paid,how_to_pay,live,free_now?,trial?}, pricing, billing, api_index, payment{provider,mode,network,chain_id,pay_to,homolog,dev,dev_gate,gratis?,facilitator,asset,asset_address,faucet,wallets}, credit{url,header} }","content":{"application/json":{"schema":{"type":"object","properties":{"product":{"type":"string","description":"Product name."},"quota":{"allOf":[{"$ref":"#/components/schemas/PaymentQuota"}],"description":"Public allowances and current list prices; not personal usage."},"pricing":{"type":"string","description":"Absolute URL of the current price list."},"billing":{"type":"string","description":"Absolute URL of payment discovery or the existing billing summary."},"api_index":{"type":"string","description":"Absolute URL of the API catalog."},"payment":{"allOf":[{"$ref":"#/components/schemas/PaymentX402"}],"description":"Public x402 configuration; pay_to=null means not configured."},"credit":{"allOf":[{"$ref":"#/components/schemas/PaymentCredit"}],"description":"Prepaid credit entry point. Never contains a balance or token."}},"required":["product","quota","pricing","billing","api_index","payment","credit"]}}}},"405":{"description":"Use GET ou HEAD."}}}}}}