> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prismgateway.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> วิธีจัดการ status code และ stable error fields

# Errors

ให้ตรวจ HTTP status ก่อน แล้วจึงใช้ `error.code` หากมี:

| Status | ความหมาย                                   | วิธีจัดการ                          |
| ------ | ------------------------------------------ | ----------------------------------- |
| `400`  | Request หรือ parameter ไม่ถูกต้อง          | แก้ request                         |
| `401`  | API key หาย ผิด หรือถูก revoke             | เปลี่ยนหรือตรวจ key                 |
| `402`  | เครดิต reservation หรือ budget ไม่พอ       | ทำตาม `action` และ `help_url`       |
| `403`  | Trial, scope, model หรือ org policy ปฏิเสธ | เลือกโมเดลที่ใช้ได้หรือติดต่อ admin |
| `404`  | มองไม่เห็น resource                        | ตรวจ ID และ caller                  |
| `429`  | เกิน rate limit                            | Backoff แล้ว retry                  |
| `5xx`  | Prism หรือ upstream ขัดข้อง                | Exponential backoff พร้อม jitter    |

อย่า retry `401`, `402` หรือ `403` อัตโนมัติ และอย่า log API key,
authorization header หรือ signed media URL

[English version](/errors)
