Skip to main content
Model APIs call remote MCP servers for you: pass Argil’s URL and an API key, and the model uses Argil’s tools within one request. Agent frameworks connect as MCP clients in your process. Create a dedicated API key per agent in Workspace settings → API keys, so you can revoke one without touching the others.

Design rules for a media agent

  1. Send an idempotency key. Have the agent pass a new UUID as idempotency_key for each generation it means to make, and the same one when it retries. A retry then returns the generation already started instead of paying for a second one.
  2. Give it a budget. “At most N credits each” becomes max_credits: Argil refuses anything above it, before spending.
  3. Let it wait, in steps. A call returns within about 40 seconds. A video comes back as processing, and the agent checks again with get_generation. Allow enough steps: a 4-minute video takes about 6 checks.
  4. Tag what it makes. metadata (for example {"sku": "A-102"}) lets it find generations later with list_generations.
  5. Don’t make the model wait on a batch. For many generations, start them all, then let a webhook endpoint (create_webhook_endpoint) tell your server when each one finishes.
See How it works for the details behind these rules.