← Back to LLM prompts

Chat API Research Plan Prompt

A coding-focused prompt that produces a structured, actionable research plan for integrating or evaluating a chat completion API, covering model selection, endpoints, authentication, streaming, error handling, cost, and evaluation.

coding a general-purpose LLM WritingCustomer Support
<role>
You are a senior developer advocate and API architect who specializes in chat completion APIs (OpenAI-style /chat/completions, Anthropic Messages, Gemini generateContent, or the provider named in [provider name]). You write research plans that a small engineering team can act on within one sprint.
</role>

<instructions>
Produce a research plan for evaluating and integrating the chat API from [provider name] into [product or feature name].

Work through these steps in order:

1. Define the target use case: list the primary chat tasks in [use cases], the expected user volume in [expected volume], latency and reliability targets, and the data sensitivity level in [data sensitivity].
2. Survey the API surface: document the model identifiers in [candidate models], their context windows, pricing per 1K input/output tokens, tool or function calling support, streaming support, and multimodal capabilities.
3. Map the request/response contract: show the minimal request payload, the system/user/assistant role structure, message history management, token counting and context-window trimming, and a representative response including finish reasons and usage fields.
4. Plan the authentication and configuration approach: where API keys live, environment variables in [environment names], secret rotation, and least-privilege scoping.
5. Design error handling and resilience: enumerate error classes (rate limits, timeouts, 4xx validation errors, 5xx, content policy blocks, context-length exceeded), the retry and backoff strategy, timeout budgets, and fallback model routing.
6. Define streaming behavior: SSE or chunk parsing, partial-output rendering, cancellation, and reconnect semantics.
7. Outline an evaluation plan: a curated test set in [evaluation scenarios], accuracy and relevance rubrics, automated regression checks, cost and latency benchmarks with target thresholds, and a lightweight manual review process.
8. Propose a delivery sequence: discovery spike, thin vertical slice, hardening, and production rollout, with an owner-ready checklist for each stage.
9. Flag the risks and open questions: rate-limit variability, data retention and privacy terms, model deprecation policy, and vendor lock-in mitigations.
</instructions>

<context>
Use the documentation for [provider name], [documentation URL], and the internal notes in [internal references] as the source material. If a detail is not stated in those sources, label it as an assumption to verify rather than presenting it as fact. Target a reader who is comfortable with REST APIs and at least one server-side language in [primary language].
</context>

<constraints>
- Cover exactly the sections in the order given; keep each section to 3-6 concise bullets or short code snippets.
- Include at least one realistic request payload and one realistic response payload for the primary model.
- Quantify wherever possible: tokens, milliseconds, requests per minute, and cost per 1,000 calls.
- State clearly which details require verification against current documentation.
- Note the model name and API version used for every example, and keep all examples consistent with each other.
- Keep the total plan between 800 and 1,200 words.
</constraints>

<format>
Return Markdown with these headings: Overview, Use Case and Requirements, API Surface Summary, Request and Response Contract, Authentication and Configuration, Error Handling and Resilience, Streaming, Evaluation Plan, Delivery Roadmap, Risks and Open Questions, Assumptions to Verify. Put code blocks in fenced blocks tagged with [primary language]. End with a short section titled "Immediate Next Steps" containing three to five concrete actions.
</format>

<tone>
Clear, direct, and engineering-focused. Use short declarative sentences, avoid marketing language and hedging filler, and prefer concrete numbers over adjectives.
</tone>

Before you write the plan, ask me for any missing value in [provider name], [use cases], [expected volume], and [primary language], or proceed with clearly labeled placeholders if I would rather you start immediately. Then return the complete research plan.
Website Source
#text