Architecture
This page explains how PlainField handles your request and turns it into observability data. It is background reading, not a set of steps.
The whole picture
The request path
- Your app sends an OpenAI-format request to the gateway, authenticated with your PlainField API key.
- The gateway validates the key, selects the provider from the
provider/modelprefix, forwards the request, and returns the response to your app. - The provider’s credentials come from PlainField’s managed access or, if you added one, your own provider key.
The observability path
After your app has its response, PlainField records the request — the model, provider, token counts, latency, estimated cost, and any metadata headers you attached. That data becomes visible in your dashboard’s Analytics view and through the REST API.
Why logging is off the request path
PlainField records each request asynchronously, after responding to your app. Writing observability data on the hot path would add latency and tie the success of your request to the health of a database. Instead, the gateway returns immediately and records the request in the background — so logging never slows your requests, and a momentary hiccup in the storage layer never fails a user-facing call.