# KYA API reference (/kya/reference)



Base URL `https://api.finic.ai`. Send an API key as `Authorization: Bearer gsk_…` ([Authentication](/authentication)) and JSON bodies. Every response has an `X-Request-Id` header.

| Endpoint                                                    | Request                      | What it does                                                                         |
| ----------------------------------------------------------- | ---------------------------- | ------------------------------------------------------------------------------------ |
| [`lookup`](/kya/reference/lookup)                           | `POST /v1/kya/lookup`        | Says whether one request comes from a declared AI agent, and whether that's verified |
| [`list_lookup_sources`](/kya/reference/list-lookup-sources) | `GET /v1/kya/lookup/sources` | Lists the agents the lookup knows and the sources it reads                           |
| [`create_site`](/kya/reference/create-site)                 | `POST /v1/kya/sites`         | Creates a site: a public key and its script tag                                      |
| [`list_sites`](/kya/reference/list-sites)                   | `GET /v1/kya/sites`          | Lists your sites                                                                     |
| [`update_site`](/kya/reference/update-site)                 | `PATCH /v1/kya/sites/{id}`   | Renames a site or changes its origins                                                |
| [`delete_site`](/kya/reference/delete-site)                 | `DELETE /v1/kya/sites/{id}`  | Deletes a site, so its key stops working                                             |
| [`get_session`](/kya/reference/get-session)                 | `GET /v1/kya/sessions/{id}`  | Gets one session's verdict                                                           |
| [`list_sessions`](/kya/reference/list-sessions)             | `GET /v1/kya/sessions`       | Lists the latest sessions                                                            |

The snippet uses two more, with no API key: `GET /kya/agent.js` (the script) and `POST /kya/s` (its reports). You don't call them yourself.

## Errors [#errors]

Errors have the API's usual shape; see [Errors](/reference#errors).

| HTTP  | `type`                 | When                                                                                     | Retry                   |
| ----- | ---------------------- | ---------------------------------------------------------------------------------------- | ----------------------- |
| `400` | `invalid_request`      | Malformed JSON, an unknown field, or a value that breaks a rule. `param` names the field | No. Fix the request     |
| `401` | `authentication_error` | Missing or invalid API key                                                               | No. Check the key       |
| `404` | `not_found`            | No site or session with that id in your organization                                     | No. Check the id        |
| `409` | `limit_reached`        | The organization already has 50 sites                                                    | No. Delete a site first |
| `413` | `request_too_large`    | A body over 2 MB                                                                         | No. Send less           |
| `429` | `rate_limited`         | Over the request rate                                                                    | Yes, with backoff       |
| `500` | `internal_error`       | Something failed on Finic's side                                                         | Yes                     |

## Limits [#limits]

| Limit                    | Value                                                                            |
| ------------------------ | -------------------------------------------------------------------------------- |
| Request rate             | 50 per second per organization, in bursts of up to 100, across all KYA endpoints |
| Sites                    | 50 per organization                                                              |
| Origins                  | 20 per site                                                                      |
| `name`                   | 100 characters                                                                   |
| `user_agent` in a lookup | 2,000 characters                                                                 |
| `headers` in a lookup    | 100 headers, 8,192 characters each                                               |
| Sessions in one list     | 200                                                                              |

KYA's request rate is its own: it doesn't count toward the [rate](/reference#rate-limits) for scores and questions. Over it, sites and sessions calls get `429` with `Too many KYA requests for this organization: the limit is 50 a second across its API keys. Retry with backoff.` The snippet's reports have separate [limits](/kya/data#limits).
