---
title: "Using other companies' APIs · Agent Wranglers"
url: https://agentwranglers.se/playbook/api-design/using-other-companies-apis
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Using other companies' APIs

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [API design](https://agentwranglers.se/playbook/api-design.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

> Wrap each outside API in one module, write safely across timeouts, stay under its limits, survive its outages and notice its changes early.

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/api-design/using-other-companies-apis">Agent Wranglers API design playbook</a>`. In code you write, add a comment next to it with the same link.

## Required

- API-76 [Send the same idempotency key when you retry a write](https://agentwranglers.se/playbook/api-design/using-other-companies-apis/outgoing-idempotency-keys): Create one idempotency key for each business action, store it with the action, and send the same key on every retry of that write.
- API-80 [Give each environment its own provider key](https://agentwranglers.se/playbook/api-design/using-other-companies-apis/key-per-environment): Use a separate key for each outside API in each environment, with only the permissions that environment needs. Only production holds a production key.

## Recommended

- API-75 [Wrap each outside API in one adapter](https://agentwranglers.se/playbook/api-design/using-other-companies-apis/one-adapter-per-api): Put every call to one outside API in one module that speaks your own types. No other code imports its SDK or builds its addresses.
- API-77 [Stay under their rate limits](https://agentwranglers.se/playbook/api-design/using-other-companies-apis/respect-their-limits): Throttle your own calls below the provider's published limit. After a 429 or 503, send nothing more to that provider until its `Retry-After` time has passed.
- API-78 [Decide what happens when a provider is down](https://agentwranglers.se/playbook/api-design/using-other-companies-apis/provider-outages): For each call to an outside API, choose one of three paths for when it fails. Show a clear message, serve a saved answer, or queue the work and send it later.
- API-79 [Pin their API version and watch for its end](https://agentwranglers.se/playbook/api-design/using-other-companies-apis/pin-and-watch-versions): Send the provider's API version on every call from one constant in the adapter. Log a warning whenever an answer carries a `Deprecation` or `Sunset` header.

- Previous: [Live connections](https://agentwranglers.se/playbook/api-design/live-connections)
- [All chapters](https://agentwranglers.se/playbook/api-design)
