AI 결제 실패 조사기: 이 결제는 왜 실패했을까?

에이전트가 결제 건, 결제 시도 내역, 결제 대행사의 상태 페이지를 읽고 원인과 지원팀의 다음 조치를 설명합니다.

  • 파일
  • 읽기 전용 연결
  • 웹
  • 콜백
  • 예산 상한

실제 실행 보기

2026년 10월 7일에 기록된 실제 실행을 다시 재생합니다. 모델: openai/gpt-6-luna.

입력
{
  "payment_id": "pay_123"
}
성공run_80b0a7e12e1b4ee6bc00299ba70cd933$0.04 중 $0.004055
  1. 대기 중예산 $0.04 예약됨
  2. MicroVMmicroVM ready
  3. MicroVMworker started · shell off · web on
  4. 파일read playbook.md
  5. 연결payments GET /payments/pay_123
  6. 결과payments GET → 200
  7. 연결payments GET /payments/pay_123/attempts
  8. 결과payments GET → 200
  9. MicroVMmicroVM destroyed
  10. 성공모델 호출 4회, 토큰 6,787개기록된 출력 (영어)

    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. 워커 폐기됨$0.004055 청구, $0.035945 반환
모델 $0.000255 · 웹 $0.00 · 컴퓨팅 $0.0038

직접 실행하기

요청이 모두 채워진 상태로 플레이그라운드에서 샘플을 엽니다. 내 계정에서 표시된 예산 안에서, 같은 읽기 전용 샘플 시스템을 대상으로 실행됩니다.

이 샘플의 예산: $0.04

작동 방식

결제 ID와 짧은 플레이북을 전달하세요. 읽기 전용 연결로 결제 API를 호출하고, 장애로 보이면 상태 페이지를 확인한 뒤 여섯 줄로 답합니다. 연결이 GET만 허용하므로 환불이나 재시도는 할 수 없습니다.

에이전트가 할 수 있는 일과 할 수 없는 일

권한은 요청의 일부입니다. 여기에 나열되지 않은 것은 실행에서 사용할 수 없습니다.

설정허용 범위
연결
payments: ephemer.al/api/samples/payments-api에서 GET만 허용
웹ephemer.al만 허용
셸꺼짐
파일playbook.md (읽기 전용)
데이터 무보존꺼짐: 기록이 30일간 보관됩니다
예산$0.04, 하드 캡
시간 제한90초

자격 증명은 머신 안으로 들어가지 않습니다. 브로커가 각 호출에 자격 증명을 추가하고 위의 메서드를 강제합니다.

코드

샘플이 보내는 정확한 요청입니다. EPHEMERAL_API_KEY를 내 조직의 멤버 키로 설정하세요.

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

요청에 포함된 파일

인라인으로 전달되므로 먼저 업로드할 필요가 없습니다. 에이전트는 각각을 읽기 전용 파일로 봅니다.

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.
전체 요청 본문 request.json

파일이 인라인으로 포함된 같은 본문입니다.

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
}

더 알아보기

관련 샘플

esc

“”와(과) 일치하는 항목이 없습니다.