Calling a model APIbeginner
Talking to Claude is an ordinary HTTP POST — a model id, a max token count, and a list of messages.
Give a model a real function to call, then handle the round trip — including the case where it asks for something that does not exist.
A question needing the tool comes back answered; a bad order id comes back as an apology, not a stack trace.
Published in full, before you start — every point is one of these and there is nothing else.
Talking to Claude is an ordinary HTTP POST — a model id, a max token count, and a list of messages.
A raw exception string tells the caller nothing they can act on; RFC 7807 ProblemDetails gives every failure the same machine-readable shape.
A proxy in front of a paid API needs a rate limit or one user can spend your whole budget, and a cancellation token so a closed browser tab stops the work.
Network calls fail. Code that assumes they succeed turns a slow connection into a blank screen with no explanation.