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 }
principal_wallet (string, optional): the deploying party's own wallet. It must differ from the counterparty wallet in parameters (same_wallet_both_parties otherwise); left out, the first wallet that signs fills the principal side
parent_contract_hash (string, optional): SHA-256 hash of a contract you created, which this one is created under (its oversight threshold then applies). Not for amendments: propose those with POST /api/v1/contracts/{id}/amend
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.
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"template": "<template>",
"parameters": "<parameters>",
"principal_declaration": "<principal_declaration>"
},
"name": "ambr_create_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template | Yes | Template slug from ambr_list_templates | |
| parameters | Yes | Template-specific parameters | |
| principal_wallet | No | The deploying party's own wallet (0x…). Must differ from the counterparty wallet in parameters. | |
| parent_contract_hash | No | SHA-256 hash of a contract you created, which this one is created under. Amendments are proposed with POST /api/v1/contracts/{id}/amend, not here. | |
| 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). |