All requests require an API key in the x-api-key header:
Getting your API key
- Log in to the Matil Dashboard
- Go to Settings > API Keys
- Click Create New Key and copy it immediately — it won’t be shown again
Example request
curl -X POST "https://api.matil.ai/v3/deployments/{deployment_id}" \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"documents": [{"type": "url", "url": "https://example.com/invoice.pdf"}]}'
import os
import requests
response = requests.post(
f"https://api.matil.ai/v3/deployments/{deployment_id}",
headers={
"x-api-key": os.environ["MATIL_API_KEY"],
"Content-Type": "application/json"
},
json={"documents": [{"type": "url", "url": "https://example.com/invoice.pdf"}]}
)
const response = await fetch(
`https://api.matil.ai/v3/deployments/${deploymentId}`,
{
method: "POST",
headers: {
"x-api-key": process.env.MATIL_API_KEY,
"Content-Type": "application/json"
},
body: JSON.stringify({
documents: [{ type: "url", url: "https://example.com/invoice.pdf" }]
})
}
);
Store your API key in an environment variable. Never hardcode it in source code or commit it to version control.