{
  "info": {
    "_postman_id": "6c8cf576-c6c3-4f2d-9e6a-ynixaiapi030",
    "name": "YNIX AI API 0.4.7",
    "description": "Coleção oficial do projeto completo. Configure as variáveis antes de executar cobranças reais.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "app_url",
      "value": "http://127.0.0.1:8000",
      "type": "string"
    },
    {
      "key": "base_url",
      "value": "http://127.0.0.1:8000/api/v1",
      "type": "string"
    },
    {
      "key": "token",
      "value": "",
      "type": "secret"
    },
    {
      "key": "admin_token",
      "value": "",
      "type": "secret"
    },
    {
      "key": "admin_email",
      "value": "admin@ynix.com.br",
      "type": "string"
    },
    {
      "key": "admin_password",
      "value": "",
      "type": "secret"
    },
    {
      "key": "provider_id",
      "value": "1",
      "type": "string"
    },
    {
      "key": "credential_id",
      "value": "1",
      "type": "string"
    },
    {
      "key": "model_id",
      "value": "1",
      "type": "string"
    },
    {
      "key": "package_id",
      "value": "1",
      "type": "string"
    },
    {
      "key": "payment_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "payment_method_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "user_id",
      "value": "1",
      "type": "string"
    },
    {
      "key": "postal_code",
      "value": "01001000",
      "type": "string"
    },
    {
      "key": "cnpj",
      "value": "19131243000197",
      "type": "string"
    },
    {
      "key": "card_number",
      "value": "",
      "type": "secret"
    },
    {
      "key": "webhook_token",
      "value": "",
      "type": "secret"
    },
    {
      "key": "project_id",
      "value": "1",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Sistema",
      "item": [
        {
          "name": "Health",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/health",
            "auth": {
              "type": "noauth"
            }
          }
        },
        {
          "name": "Capacidades",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/capabilities",
            "auth": {
              "type": "noauth"
            }
          }
        },
        {
          "name": "Documentação OpenAPI",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{app_url}}/docs/openapi.yaml",
            "auth": {
              "type": "noauth"
            }
          }
        }
      ]
    },
    {
      "name": "Autenticação",
      "item": [
        {
          "name": "Registrar",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/auth/register",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Carlos André\",\n  \"email\": \"carlos@example.com\",\n  \"password\": \"Senha@12345\",\n  \"password_confirmation\": \"Senha@12345\",\n  \"document\": \"52998224725\",\n  \"phone\": \"11999999999\",\n  \"timezone\": \"America/Sao_Paulo\",\n  \"device_name\": \"Postman\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Resposta válida', () => pm.expect(pm.response.code).to.be.oneOf([200, 201]));",
                  "const json = pm.response.json();",
                  "if (json.data && json.data.token) pm.collectionVariables.set('token', json.data.token);",
                  "if (json.data && json.data.user && json.data.user.is_admin) pm.collectionVariables.set('admin_token', json.data.token);"
                ]
              }
            }
          ]
        },
        {
          "name": "Login administrador",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/auth/login",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"{{admin_email}}\",\n  \"password\": \"{{admin_password}}\",\n  \"device_name\": \"Postman Admin\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Resposta válida', () => pm.expect(pm.response.code).to.be.oneOf([200, 201]));",
                  "const json = pm.response.json();",
                  "if (json.data && json.data.token) pm.collectionVariables.set('token', json.data.token);",
                  "if (json.data && json.data.user && json.data.user.is_admin) pm.collectionVariables.set('admin_token', json.data.token);"
                ]
              }
            }
          ]
        },
        {
          "name": "Reenviar verificação",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/auth/verify-email/resend",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Confirmar senha do admin",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/auth/confirm-password",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"password\": \"{{admin_password}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Esqueci a senha",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/auth/forgot-password",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"{{admin_email}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Logout",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/auth/logout",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Conta e tokens",
      "item": [
        {
          "name": "Meu perfil",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/me",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Atualizar perfil",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/me",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Carlos André\",\n  \"phone\": \"11999999999\",\n  \"timezone\": \"America/Sao_Paulo\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Listar tokens",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/api-tokens",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Criar token",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/api-tokens",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Integração\",\n  \"abilities\": [\n    \"chat:create\",\n    \"models:read\",\n    \"credits:read\",\n    \"billing:read\",\n    \"billing:create\",\n    \"brasil:read\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "IA",
      "item": [
        {
          "name": "Listar modelos",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/models",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Chat",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Idempotency-Key",
                "value": "postman-chat-{{$guid}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/chat/completions",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"model\": \"auto\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Explique o que é um gateway de IA.\"\n    }\n  ],\n  \"stream\": false,\n  \"reasoning_effort\": \"medium\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Consumo e projetos",
      "item": [
        {
          "name": "Estimar consumo",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/cost-estimates",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"model\": \"auto\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"Explique filas no Laravel.\"\n    }\n  ],\n  \"max_tokens\": 1200,\n  \"max_credits\": 150,\n  \"project_id\": 1\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Resumo de gastos",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/usage?period=month",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Listar projetos",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/projects",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Criar projeto",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/projects",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Aplicação principal\",\n  \"environment\": \"test\",\n  \"description\": \"Ambiente de desenvolvimento\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Ver projeto",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/projects/{{project_id}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Atualizar projeto",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/projects/{{project_id}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Aplicação principal\",\n  \"status\": \"active\",\n  \"description\": \"Projeto atualizado\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Remover ou arquivar projeto",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/projects/{{project_id}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Créditos e Asaas",
      "item": [
        {
          "name": "Consultar carteira",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/credits",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Livro-caixa",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/credits/transactions",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Pacotes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/credit-packages",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Listar recargas",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/recharges",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Criar recarga Pix",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Idempotency-Key",
                "value": "postman-pix-{{$guid}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/recharges",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"credit_package_id\": \"{{package_id}}\",\n  \"billing_type\": \"PIX\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json(); if (json.data && json.data.id) pm.collectionVariables.set('payment_id', json.data.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Consultar recarga",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/recharges/{{payment_id}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Sincronizar recarga",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/recharges/{{payment_id}}/refresh",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Cancelar recarga",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/recharges/{{payment_id}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Listar cartões",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/payment-methods",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Tokenizar cartão",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/payment-methods",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"credit_card\": {\n    \"holderName\": \"Cliente Sandbox\",\n    \"number\": \"{{card_number}}\",\n    \"expiryMonth\": 12,\n    \"expiryYear\": 2030,\n    \"ccv\": \"123\"\n  },\n  \"holder_info\": {\n    \"name\": \"Cliente Sandbox\",\n    \"email\": \"cliente@example.com\",\n    \"cpf_cnpj\": \"52998224725\",\n    \"postal_code\": \"01001000\",\n    \"address_number\": \"100\",\n    \"address_complement\": \"Sala 1\",\n    \"phone\": \"11999999999\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json(); if (json.data && json.data.id) pm.collectionVariables.set('payment_method_id', json.data.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Recarga com cartão salvo",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Idempotency-Key",
                "value": "postman-card-{{$guid}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/recharges",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"credit_package_id\": \"{{package_id}}\",\n  \"billing_type\": \"CREDIT_CARD\",\n  \"saved_payment_method_id\": \"{{payment_method_id}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "BrasilAPI",
      "item": [
        {
          "name": "Consultar CEP",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/brazil/postal-codes/{{postal_code}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Consultar CNPJ",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/brazil/companies/{{cnpj}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Administração de IA",
      "item": [
        {
          "name": "Listar provedores",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/providers",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Consultar provedor",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/providers/{{provider_id}}",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Criar provedor",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/providers",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"OpenAI\",\n  \"slug\": \"openai\",\n  \"driver\": \"openai-compatible\",\n  \"base_url\": \"https://api.openai.com/v1\",\n  \"status\": \"active\",\n  \"priority\": 100,\n  \"timeout_seconds\": 120,\n  \"headers\": {},\n  \"settings\": {}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json(); if (json.data && json.data.id) pm.collectionVariables.set('provider_id', json.data.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Credenciais do provedor",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/providers/{{provider_id}}/credentials",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Cadastrar credencial",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/providers/{{provider_id}}/credentials",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Principal\",\n  \"environment\": \"production\",\n  \"secret\": {\n    \"api_key\": \"INSIRA_A_CHAVE\"\n  },\n  \"status\": \"active\",\n  \"priority\": 100,\n  \"settings\": {}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json(); if (json.data && json.data.id) pm.collectionVariables.set('credential_id', json.data.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Testar credencial",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/provider-credentials/{{credential_id}}/test",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Listar modelos admin",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/models",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Criar modelo",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/models",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"provider_id\": \"{{provider_id}}\",\n  \"external_id\": \"gpt-4.1-mini\",\n  \"name\": \"GPT 4.1 Mini\",\n  \"alias\": \"gpt-mini\",\n  \"status\": \"active\",\n  \"priority\": 100,\n  \"capabilities\": [\n    \"chat\",\n    \"streaming\",\n    \"reasoning\",\n    \"tools\",\n    \"vision\",\n    \"files\"\n  ],\n  \"context_window\": 1000000,\n  \"max_output_tokens\": 32768,\n  \"input_credit_units_per_million\": 1000,\n  \"output_credit_units_per_million\": 4000,\n  \"request_base_credit_units\": 1,\n  \"settings\": {}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json(); if (json.data && json.data.id) pm.collectionVariables.set('model_id', json.data.id);"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Administração financeira",
      "item": [
        {
          "name": "Status Asaas",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/integrations/asaas",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Testar Asaas",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/integrations/asaas/test",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Sincronizar webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/integrations/asaas/webhook/sync",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Listar pacotes admin",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/credit-packages",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Criar pacote",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/credit-packages",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Inicial\",\n  \"slug\": \"inicial\",\n  \"amount_cents\": 1000,\n  \"credit_units\": 10000,\n  \"bonus_credit_units\": 0,\n  \"is_active\": true,\n  \"sort_order\": 10,\n  \"metadata\": {}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json(); if (json.data && json.data.id) pm.collectionVariables.set('package_id', json.data.id);"
                ]
              }
            }
          ]
        },
        {
          "name": "Conceder créditos",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/users/{{user_id}}/credits",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount_units\": 10000,\n  \"description\": \"Crédito administrativo\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Auditoria",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/admin/audit-logs",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{admin_token}}",
                  "type": "string"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Webhook Asaas",
      "item": [
        {
          "name": "Simular PAYMENT_RECEIVED",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "asaas-access-token",
                "value": "{{webhook_token}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": "{{base_url}}/webhooks/asaas",
            "description": "Use somente com um pagamento local correspondente ou em testes controlados.",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": \"evt_postman_{{$timestamp}}\",\n  \"event\": \"PAYMENT_RECEIVED\",\n  \"payment\": {\n    \"id\": \"pay_exemplo\",\n    \"externalReference\": \"recharge:exemplo\",\n    \"billingType\": \"PIX\",\n    \"status\": \"RECEIVED\",\n    \"value\": 10\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    }
  ]
}
