An API is a boundary that lets client software use operations or data exposed by another system. An external API belongs to a separately operated service, such as Stripe, SendGrid, or Twilio, rather than a process your team runs. section 9.1 section 8.3.1
Identify an API by asking where it runs, who calls it, and what evidence exposes the connection:
- Classify the connection as a call to vendor code on a vendor's machine; treat Stripe, SendGrid, and Twilio as external API nodes. section 9.1
- Search environment files for provider credentials such as STRIPE_SECRET_KEY, SENDGRID_API_KEY, or OAuth client IDs. section 9.2
- Confirm the integration in application code: an SDK import and client setup prove that the application actually calls the service. section 9.2
- Separate public APIs from internal APIs: public interfaces promise stability to outside integrators, while internal interfaces can be refactored by their owning team. section 8.3.1
- Check whether the call is synchronous or asynchronous; synchronous calls expose vendor latency directly, while asynchronous messages may fail without the user noticing. section 9.1
Tracing a payment API
A payments module imports Stripe, creates a client from STRIPE_SECRET_KEY, and calls stripe.charges.create with an amount and currency. The service is not listed in docker-compose.yml because Stripe runs outside the application. Its public call belongs on the architecture graph, where its latency, availability, authentication, and retry behavior can be investigated. section 9.2 section 9.1
Listing 2.2 Calling an LLM from code via its API.
from openai import OpenAI
client = OpenAI()
#A
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "What is 2+2?"}]
)
print(response.choices[0].message.content)Use the node-and-edge classification to distinguish an external API call from programs your team runs, rented infrastructure, and client software. section 9.1

























































