AI Assistant
The extractor assistant helps you turn a natural language description of your raw event into extractor configuration JSON.
Use it when you know the event shape but do not want to write the extractor JSON from scratch.
Open the assistant
Section titled “Open the assistant”- Open Rules.
- Select Create extractor draft.
- Select Ask assistant.
- Describe the event shape, subject, dimensions, metrics, and prices.
- Select Generate config.
The generated JSON replaces the extractor draft editor. Review it before creating the draft.
What to include in the prompt
Section titled “What to include in the prompt”Good prompts name the exact fields in the raw event.
Include:
- the subject field, such as
meta.user_id,workspace_id, orapi_key_id; - dimensions you want on every usage event, such as provider, model, plan, or region;
- charge item metrics, such as input tokens, output tokens, requests, workflow runs, or tool calls;
- units and pricing when known;
- whether sparse dynamic metrics will be reported through
x-billing.
Example prompt
Section titled “Example prompt”Our raw event has meta.user_id, provider, usage.model,usage.prompt_tokens, and usage.output_tokens.Use meta.user_id as the subject.Keep provider and usage.model as dimensions.Create prompt_tokens and output_tokens charge items in unit tokens.Bill prompt tokens at 2.00 USD per 1M tokens and output tokens at 8.00 USD per 1M tokens.Also add one request item.Review before creating
Section titled “Review before creating”Always review generated JSON before saving it.
Check:
- paths match the real raw event;
- metric names are stable;
- units are consistent;
- pricing currency and scale are correct;
- subject type and subject ID match the account routing model you plan to use.
If the result is close but not exact, edit the JSON in the draft editor and create the draft after review.