ambr_create_contract
Generate a Ricardian Contract from a template.
Creates a dual-format contract (human-readable legal text + machine-parsable JSON) using AI, linked by SHA-256 hash. The contract is stored on Ambr and accessible via the Reader Portal.
Requires a valid API key (X-API-Key header on the HTTP request) with available credits. Use ambr_list_templates first to discover templates and their required parameters.
Args:
template (string, required): Template slug (e.g. "d1-general-auth")
parameters (object, required): Template-specific parameters matching the schema
principal_declaration (object, required): { agent_id, principal_name, principal_type }
parent_contract_hash (string, optional): SHA-256 hash of parent contract for amendments
oversight_threshold_usd (number, optional): spending level above which work created under this contract needs human approval. Children exceeding it halt at awaiting_principal_approval.
amendment_type (string, optional): "original" | "amendment" | "extension"
Returns:
contract_id: Unique ID (e.g. "amb-2026-0042")
sha256_hash: SHA-256 hash for verification
status: Contract status
reader_url: URL to view in Reader Portal
credits_remaining: Remaining API credits
Legibility: Output is dual-format by construction and replayable to the original SHA-256 hash — the basis of Ambr's legibility guarantee.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template | Yes | Template slug from ambr_list_templates | |
| parameters | Yes | Template-specific parameters | |
| amendment_type | No | ||
| parent_contract_hash | No | SHA-256 hash of parent contract (for amendments) | |
| principal_declaration | Yes | ||
| oversight_threshold_usd | No | Spending level above which work created UNDER this contract requires human approval. A child contract exceeding the parent threshold is held at awaiting_principal_approval until a human signs, and cannot be signed or activated before then (EU AI Act Art. 14). |