CORS & origins

The origin allowlist, why embed keys demand an Origin, and how to debug a 403.

dev · https://api.dev.oprag.ai

Every project carries an allowlist of browser origins. It is what makes an embed key safe to publish: the key is public, but it only works from somewhere you named.

The rules, by key kind

Key kindNo Origin headerOrigin presentEmpty allowlist
Embed403. There is no server-side fallback.Must be on the allowlist.Rejects everything.
IntegrationAllowed — this is the server-to-server case.Must be on the allowlist.Rejects every browser origin.

Matching is exact

  • Scheme, host, and port all count: https://example.com does not cover http://example.com or https://www.example.com.
  • There are no wildcards. List each origin you serve from.
  • Local development needs its own entry, e.g. http://localhost:5173.

Debugging a 403

MessageCause
Embed keys require a browser Origin headerAn embed key was used from a server, or from a client that stripped the Origin header. Use an integration key for server-to-server calls.
Origin not allowed for this projectThe request's Origin is not on the project's allowlist. Add it in the dashboard under the project's settings.
IP address not allowed for this projectThe project has an IP allowlist and the caller's address is not on it. Checked before the request body is even parsed.

Preflight is handled for you: OPTIONS on any /v1/ path returns 204 before authentication runs, so a preflight never fails for a credential reason.

Ready to ship?

Get started free