Separate the decisions
Treat the workflow as distinct stages:- Select: identify the capability that could complete the task.
- Estimate: determine the documented price unit and expected workflow cost.
- Authorize: compare the cost and capability type with policy.
- Execute: submit the approved request through the documented interface.
- Verify payment: confirm the usage or settlement record.
- Verify delivery: confirm the API response is complete and usable.
- Audit: record the decision, amount, resource, and outcome without secrets.
Define policy before execution
Keep authorization policy outside the model prompt where possible. Enforce it in application code or another trusted control layer.
Recommended workflow
1. Define the task and success condition
Specify the output required, acceptable quality, deadline, and maximum spend. A vague success condition can lead to unnecessary calls or repeated purchases.2. Choose the smallest sufficient capability
Use Capabilities by Goal and Capabilities by Interface to identify whether the task needs a model, direct API, Skill, or another resource. Do not purchase a broader or more expensive capability when a documented smaller surface satisfies the requirement.3. Read current billing and availability information
Before approval, verify:- Exact model, API, or capability identifier.
- Current price unit and authentication requirements.
- Availability, rate limits, and known constraints.
- Whether the flow uses normal AIsa balance deduction or another documented payment mechanism.
4. Authorize the request
Compare the estimate with policy. If confirmation is required, show:- The capability and intended task.
- Expected price or maximum authorized amount.
- Funding source or billing boundary.
- What happens if the result fails or is incomplete.
- Whether a retry can incur another charge.
5. Execute once and preserve identifiers
Submit the request through the exact documented API. Preserve any request, usage, transaction, or correlation identifiers returned by the system. Use idempotency controls only when the capability explicitly supports them. Do not invent an idempotency key contract for an endpoint that does not document one.6. Reconcile ambiguous outcomes
Network timeout does not prove that a request failed before billing.
7. Audit without exposing secrets
Record only the fields needed for review, such as:- Task and policy decision.
- Capability identifier.
- Authorized and actual amount when available.
- Request or transaction reference.
- Result status and verification outcome.
- Retry or fallback decisions.
When autonomous purchasing is useful
Consider it when:- Resource needs vary by task.
- A dedicated provider subscription is not justified for occasional use.
- The workflow can state a clear maximum spend.
- The application can verify both billing and delivery.
- Budget, confirmation, retry, and audit controls are enforceable.