API Integration Scaffold
Copilot Chat generates more accurate API clients when it knows the auth method, base URL, and specific endpoints upfront. Specifying typed errors and retry logic avoids the most common follow-up edits developers make to generated API code.
Create a typed API client for the {{apiName}} API in #file:{{filePath}}. Requirements: - Base URL: {{baseUrl}} - Auth: {{authMethod}} ({{authDetails}}) - Endpoints to implement: {{endpoints}} - Use fetch with proper error handling (throw typed errors) - Add request/response TypeScript interfaces for each endpoint - Include retry logic with exponential backoff (max {{maxRetries}} retries) - Add JSDoc with example usage for each method
Variables to customize
Why this prompt works
Copilot Chat generates more accurate API clients when it knows the auth method, base URL, and specific endpoints upfront. Specifying typed errors and retry logic avoids the most common follow-up edits developers make to generated API code.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Get thorough code reviews with actionable feedback tailored to your language, framework, and standards.
Context-Aware Code CompletionProviding the surrounding code and project context lets the model match existing patterns exactly. The constraint against modifying existing code prevents unwanted side effects.
Inline Code SuggestionConstraining suggestions to match existing style and scope produces insertions that feel native to the codebase. The 'no explanation' rule mimics real inline completion behavior.
Code ExplanationThe audience level parameter adjusts complexity automatically. Requiring a usage example ensures the explanation is practical, not just theoretical.