RecipesstableUpdated 2026-05-14

Track OpenAI with Gateway

Route OpenAI traffic through Kadryn Gateway and verify cost, traces and metadata.

Goal

Send an OpenAI request through Kadryn Gateway and confirm that the request appears in Kadryn with project, environment, model, token usage and cost attribution.

Before you start

  • You have a Kadryn workspace and project.
  • You created a server-side Kadryn API key.
  • Your OpenAI provider key is configured in Kadryn or available through your provider-key setup.
  • You know which environment the request belongs to.

Steps

  1. Open Developers > Gateway in Kadryn.
  2. Copy the gateway endpoint for your workspace.
  3. Update your backend provider client to call Kadryn instead of OpenAI directly.
  4. Add project, feature and environment metadata.
  5. Send a non-sensitive test prompt.
  6. Open Developers > Logs & Traces and search by request ID.
  7. Confirm that Costs shows normalized usage for the project.

Expected result

You should see a successful gateway request, a provider response, normalized token usage and project-level cost attribution.

Troubleshooting

If the request is missing, check authentication first. If it is present but unallocated, fix metadata. If it is blocked, open the matching Guardrails decision and review the policy reason.