Investigador de pagos fallidos con IA: ¿por qué falló este pago?

Un agente lee un pago, sus intentos y la página de estado del procesador, y explica la causa y el siguiente paso para tu equipo de soporte.

  • Archivos
  • Conexión de solo lectura
  • Web
  • Callback
  • Límite de presupuesto

Mira una ejecución real

Una ejecución real del 7 oct 2026, reproducida. Modelo: openai/gpt-6-luna.

Entrada
{
  "payment_id": "pay_123"
}
Completadarun_80b0a7e12e1b4ee6bc00299ba70cd933$0.004055 de $0.04
  1. En colapresupuesto de $0.04 reservado
  2. MicroVMmicroVM ready
  3. MicroVMworker started · shell off · web on
  4. Archivoread playbook.md
  5. Conexiónpayments GET /payments/pay_123
  6. Resultadopayments GET → 200
  7. Conexiónpayments GET /payments/pay_123/attempts
  8. Resultadopayments GET → 200
  9. MicroVMmicroVM destroyed
  10. Completada4 llamadas al modelo, 6,787 tokensResultado grabado (en inglés)

    Cause: The card issuer declined the payment for insufficient funds.
    Evidence: failure_code=insufficient_funds; failure_message=The card issuer declined the charge: insufficient funds. Both attempts failed for the same reason.
    Next step: Suggest the customer retry or use another card.

  11. Worker destruido$0.004055 cobrados, $0.035945 liberados
Modelo $0.000255 · Web $0.00 · Cómputo $0.0038

Ejecútalo tú mismo

Abre el ejemplo en el playground con la solicitud completa ya rellenada. Se ejecuta en tu propia cuenta, dentro del presupuesto indicado, contra los mismos sistemas de ejemplo de solo lectura.

Presupuesto de este ejemplo: $0.04

Cómo funciona

Dale un ID de pago y un breve manual de actuación. Llama a tu API de pagos con una conexión de solo lectura, consulta la página de estado cuando el fallo parece una caída del servicio y responde en seis líneas. No puede reembolsar ni reintentar nada, porque la conexión solo permite GET.

Lo que el agente puede y no puede hacer

Los permisos forman parte de la solicitud. Todo lo que no figura aquí no está disponible para la ejecución.

AjustePermitido
Conexiones
payments: solo GET, en ephemer.al/api/samples/payments-api
WebSolo ephemer.al
ShellDesactivado
Archivosplaybook.md (solo lectura)
Retención cero de datosDesactivada: el registro se conserva 30 días
Presupuesto$0.04, límite estricto
Tiempo límite90 segundos

Las credenciales nunca entran en la máquina: un broker las añade a cada llamada y aplica los métodos indicados arriba.

El código

Esta es la solicitud exacta que envía el ejemplo. Define EPHEMERAL_API_KEY con una clave de miembro de tu organización.

curl -X POST $EPHEMERAL_URL/v1/runs \
  -H "Authorization: Bearer $EPHEMERAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d @request.json

Archivos de la solicitud

Se pasan en línea, así que no hay que subir nada antes. El agente ve cada uno como un archivo de solo lectura.

playbook.md
playbook.md
# Failed payment playbook

You can only read. The payments connection allows GET, and web access is limited to ephemer.al.

1. GET /payments/{payment_id}. Note status, amount, currency, failure_code and failure_message.
2. GET /payments/{payment_id}/attempts. Check whether earlier attempts failed for the same reason.
3. If failure_code is processor_error or timeout, read https://ephemer.al/api/samples/status for incidents around that time.
4. Decide the cause:
   - card_declined, insufficient_funds, expired_card: the customer's bank or card. Suggest a retry or another card.
   - processor_error, timeout: ours or the processor's. Say whether the status page shows an incident.
   - fraud_review: a risk rule held it. Do not suggest bypassing it.
5. Never guess. If a call fails or a field is missing, say so.

Answer in at most six lines: the cause, the evidence (field and value) and the next step for the support agent.
Do not include card numbers or customer email addresses.
Cuerpo completo de la solicitud request.json

El mismo cuerpo, con los archivos en línea.

request.json
{
  "prompt": "Find out why the payment in input.payment_id failed. Follow playbook.md exactly. Use only what the data returns and never guess; if a call fails or a field is missing, say so.",
  "input": {
    "payment_id": "pay_123"
  },
  "files": [
    {
      "path": "playbook.md",
      "content": "# Failed payment playbook\n\nYou can only read. The payments connection allows GET, and web access is limited to ephemer.al.\n\n1. GET /payments/{payment_id}. Note status, amount, currency, failure_code and failure_message.\n2. GET /payments/{payment_id}/attempts. Check whether earlier attempts failed for the same reason.\n3. If failure_code is processor_error or timeout, read https://ephemer.al/api/samples/status for incidents around that time.\n4. Decide the cause:\n   - card_declined, insufficient_funds, expired_card: the customer's bank or card. Suggest a retry or another card.\n   - processor_error, timeout: ours or the processor's. Say whether the status page shows an incident.\n   - fraud_review: a risk rule held it. Do not suggest bypassing it.\n5. Never guess. If a call fails or a field is missing, say so.\n\nAnswer in at most six lines: the cause, the evidence (field and value) and the next step for the support agent.\nDo not include card numbers or customer email addresses.\n"
    }
  ],
  "connections": {
    "payments": {
      "type": "http",
      "url": "https://ephemer.al/api/samples/payments-api",
      "auth": {
        "type": "bearer",
        "token": "sample_read_key"
      },
      "allowed_methods": [
        "GET"
      ],
      "instructions": "GET /payments/{id} returns a payment (status, amount in cents, currency, failure_code, failure_message, attempt_count). GET /payments/{id}/attempts returns its attempts."
    }
  },
  "web": {
    "allow": [
      "ephemer.al"
    ],
    "search": false
  },
  "shell": false,
  "timeout_seconds": 90,
  "max_cost_micros": 40000
}

Más información

Ejemplos relacionados

esc

Nada coincide con “”.