Prompt Engineering

Getting reliable behaviour out of a model with nothing but the message you send it.

Sign in to track your progress across sections.

12 articles

Structured Output

Listed inStructured OutputPrompt Engineeringon

Asking for JSON in the prompt, JSON mode, and schema-constrained output give different guarantees. JSON mode promises syntactically valid JSON and not conformance to your schema, which is the gap most applications trip on.

Intermediate4 min
#prompting
#api

System Prompting

Listed inSystem PromptingPrompt Engineeringon

The Messages API takes the system prompt as its own parameter rather than a first message. Putting the date or a user's name in it stops the prefix caching, so you pay the write premium and never collect the read discount.

Beginner3 min
#prompting

Chain of Thought

Listed inChain of ThoughtPrompt Engineeringon

On models that reason by default, asking for step-by-step thinking pays for the steps twice. Carried-over verification instructions cause over-verification, and tag conventions are a weak way to separate reasoning from the answer.

Intermediate3 min
#prompting
#reasoning