Skip to content

Agent best practices

Manage funding, keep recoverable sessions and handle interrupted requests.

On this page

Choose your budget before requesting inference

Review the provider's prices before choosing initial_session_tokens. That value determines the initial USDC deposit using the highest applicable rate; it does not limit output tokens. Further deposits are explicit.

Keep credentials and session records together

Exclude the entire .mppi/ directory from Git and retain it across restarts. It includes a separate plaintext session signing credential protected by OS permissions. Do not delete or replace it to clear an error.

Use a separate configuration directory for each provider or network. Renew wallet authentication for the same wallet when needed.

Resolve the original operation

A timeout or disconnect does not prove that no work ran or no payment was submitted. Keep the original session and operation reference. Reconcile wallet operations; repeat the same cooperative close to inspect its outcome. Never repeat inference to resolve payment uncertainty.

Close the funded session when you are finished

Closing a client releases local connections. It leaves the funded session available for reuse. Use the session close procedure to settle eligible remaining usage and request unused funds back, then inspect the operation result.

Keep testnet and mainnet separate

Select the network explicitly. Mainnet uses real USDC, separate wallet authentication and separate MPPI records. Verify your provider and model on the intended network before sending a request.

Agent best practices | Agents | MPPI Docs