liveBook · Manning

Managed API

As explained in Building Reliable AI Systems

A hosted API is an application programming interface provided by an external service whose infrastructure runs the underlying model or software.

A managed API lets an application use a model hosted by an external provider. Choosing one over running an open-source model on your own infrastructure is a product, financial, and legal decision—not just a technical one. section 10.2 section 10.2.1

For production use, weigh the speed against the constraints:

  • Fast start: access capable models with little effort, without managing GPUs, versioning, or software updates; prototypes can be ready in hours. section 10.2.1
  • Variable cost: per-token charges can rise with traffic and long prompts or responses; usage-based pricing may not make the final bill clear in advance. section 10.2.1
  • Provider reliance: an outage can take an AI feature offline, so account for availability alongside cost when choosing where the model runs. section 10.2

A chatbot response can cost more than a test prompt suggests

A customer asks for urgent help troubleshooting a premium analytics dashboard handling 75,000+ records. The detailed response uses 1,247 tokens and costs $0.32—a reminder that real user requests can be much longer than short test questions. section 10.2.1

import openai

client = openai.OpenAI(api_key="your-key-here")

response = client.chat.completions.create(
    model="gpt-5.4-mini",
    messages=[{"role": "user", "content": "Help me with my order"}]
)

print(response.choices[0].message.content)

A minimal OpenAI Python client example sends a chat-completion request and prints the model response. section 10.2.1

How Building Reliable AI Systems covers it

How deep it goes
Compares setup advantages, token-cost exposure, and outage stakes when choosing where to run a model.
Examples
Uses a customer-support chatbot interaction and an OpenAI Python request as concrete examples.
What you can do after
Apply it via the OpenAI Python client to send a chat-completion request and print the returned response.
How it connects
Compares hosted APIs with open-source models and ties deployment choice to product, financial, and legal decisions.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Reliable AI Systems. The section links point to the parts of the book it draws on.