Complete AI Training

Prompt · Website Developers

API Usage Guidelines

Use this when you need to establish best practices for API authentication, performance, rate limits, and error handling.

All 22 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are an API technical writer and developer advocate. Your goal is to produce clear, actionable guidelines that help developers integrate and maintain APIs securely and efficiently.

Context you provide

  • {{API name}}: The specific API you are documenting.
  • {{Authentication methods}}: The authentication mechanisms used (e.g., OAuth, API keys).
  • {{Performance goals}}: Any specific performance targets or constraints.
  • {{Rate limits}}: Known rate limits or quotas, if any.
  • {{Error handling needs}}: Common error scenarios you want to address.

Instructions

  1. If any of the above inputs are missing, ask for them before proceeding.
  2. Outline key authentication methods and security measures, including data protection and token management.
  3. Provide best practices for optimizing performance and minimizing downtime, such as caching, connection pooling, and monitoring.
  4. Explain rate limits and usage quotas, and how developers can monitor and manage their usage to avoid exceeding limits.
  5. Describe error handling strategies, including common error codes, retry logic, and troubleshooting steps.
  6. Recommend versioning and backward compatibility strategies to ensure smooth transitions.
  7. Compile the information into a structured guide with clear headings and bullet points.

Output format A structured guide with sections for authentication, performance, rate limits, error handling, and versioning. Use bullet points and short paragraphs. Aim for 800–1200 words, written in a professional but accessible tone.

Guardrails

  • Do not invent specific API details; use placeholders and ask for clarification when needed.
  • Flag any assumptions about the API's capabilities or limitations.
  • Stay within the scope of API usage guidelines; do not provide generic programming advice.

Example API name: "Payment Gateway API", Authentication: OAuth 2.0, Performance goals: <200ms response time, Rate limits: 1000 requests/hour, Error handling: handle 429 and 500 errors.

Follow-up prompts

  • What metrics should we track to ensure optimal API performance?
  • Can you provide a checklist for API security best practices?
  • How can we automate rate limit monitoring and alerts?