Docs / Fields, types and tokens
Fields, types and tokens
A query says which emails you want, and it can also say which fields come back. The SDK turns those fields into types, so you skip the prompt, the parsing and the validation.
Fields
Section titled “Fields”Fields sit next to the query in the access. A ? marks a field that can be empty.
query: > from:(iberia.com OR booking.com OR renfe.es OR airbnb.com) subject:(booking OR reservation OR itinerary)fields: is_cancellation: boolean cancellation_notes: string? refunded: booleanThe SDK turns those fields into types, next to basic info: the sender, date and subject.
// Generated by the SDKtype TravelBooking = { from: string; date: string; subject: string; isCancellation: boolean; cancellationNotes: string | null; refunded: boolean;};Tokens
Section titled “Tokens”A token is one processed unit of an email, such as a piece of extracted information. It isn’t an LLM token. The Developer plan costs $0.01 per 1M tokens, pay as you go.
| You ask for | Tokens per email | 1 million emails cost |
|---|---|---|
| Basic info | 1 | $0.01 |
| Basic info with the three fields above | 3 | $0.03 |
These are the only two counts published, so don’t work out a price per field from them.