Introduction
The MilkStraw AI API gives you your inventory, commitments, spend, savings, projects, and bills as JSON. It's read-only.
The base URL is https://app.milkstraw.ai/api.
Create an API key#
An Admin or Owner opens Settings > Integrations and clicks Create API key. Name the key, pick when it expires (90 days, 1 year, or never), and copy it. We show the full key once, so store it somewhere safe. Revoking a key on the same page cuts off its access immediately.
An API key belongs to your organization, not to the person who created it. It can read every endpoint in this reference, for its own organization only.
Make your first request#
Send the key as a Bearer token. Start with your organization, since every other path includes its ID:
curl https://app.milkstraw.ai/api/organizations \
-H "Authorization: Bearer $MILKSTRAW_API_KEY"{
"organizations": [
{
"id": "7f3c9a52-1b8e-4d2a-9c61-0e5b4f8a2d17",
"name": "Acme",
"onboarding": "complete",
"management_account": {
"id": "c2a1e8f4-6d3b-4f7a-8e29-5b1c0d9a3f62",
"nickname": "acme-management",
"account_id": "123456789012",
"access": "granted"
}
}
]
}Then list your EC2 instances with that ID:
curl "https://app.milkstraw.ai/api/organizations/$ORGANIZATION_ID/inventory/ec2?region=us-east-1" \
-H "Authorization: Bearer $MILKSTRAW_API_KEY"Use the OpenAPI document#
The OpenAPI document describes every endpoint, parameter, and field, with an example response. Import it into Postman or Insomnia, generate a client with any OpenAPI generator, or point your coding agent at it.