run_prompt_completion
Execute a prompt template with substituted variables, returning a model completion and attributing billing costs to client, app, and environment.
Instructions
Execute a prompt against the configured model and return the completion. This makes a billable model call, so use render_prompt first when you want to check the template and validate_completion_metadata when billing fields are uncertain.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt_id | Yes | Prompt ID or slug to execute | |
| variables | Yes | Variable values to substitute into the template | |
| metadata | Yes | Billing metadata - client_id, app, env are REQUIRED for cost attribution | |
| hyperparameters | No | Override default hyperparameters |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |