API Academy
🌐 English
  • 🌐 English
  • 🌐 繁體中文
HomePetstore APIExplore more APIs
HomePetstore APIExplore more APIs
🌐 English
  • 🌐 English
  • 🌐 繁體中文
🌐 English
  • 🌐 English
  • 🌐 繁體中文
  1. Developing APIs
  • Introduction
  • Table of Contents
  • API Academy
    • Get Started
      • What is an API?
      • How Does an API Work?
      • How to Call an API?
      • How to Read an API Documentation?
      • Chapter Summary
      • Get realtime weather
    • API Fundamentals
      • API Funtamentals: Overview
      • Method & Path
      • Parameters
      • Request Body
      • Responses
      • API Specification & OAS
      • Chapter Summary
    • Working with APIs
      • Working with APIs: Overview
      • Making Requests from Spec
      • Environments and Variables
      • Chaining Multiple Endpoints
      • Handling Authentication
      • Handling API Signatures
      • Introduction to Scripts
      • Chapter Summary
    • Mocking APIs
      • Mocking APIs: Overview
      • Smart Mock
      • Mock Expectations
      • Cloud Mock
      • Mock Scripts
      • Chapter Summary
    • Designing APIs
      • Designing APIs: Overview
      • Introduction to API Design
      • Creating Your First API Project
      • Analyzing Requirements and Planning Your API
      • Designing Data Models
      • Designing Endpoints
      • Using Components and Reusability
      • Setting Up Authentication
      • API Design Guidelines
      • Chapter Summary
    • Developing APIs
      • Developing APIs: Overview
      • Setup: Install Your AI Coding Assistant
      • Quick Start: From Spec to Running API in 30 Minutes
      • Understanding the Generated Code
      • Testing Your API with Apidog
      • Deployment: Put Your API Online
      • Chapter Summary
    • Testing APIs
      • Testing APIs: Overview
      • Getting Started: Your First Test Scenario
      • Integration Testing and Data Passing
      • Dynamic Values
      • Assertions and Validations
      • Flow Control: If, For, ForEach
      • Data-Driven Testing
      • Performance Testing
      • Test Reports and Analysis
      • CI/CD Integration
      • Scheduled Tasks and Automation
      • Advanced Testing Strategies
      • Chapter Summary
    • API Documentations
      • API Documentations: Overview
      • Publishing Your First API Doc
      • Customizing Documentation Appearance
      • Interactive Features for Consumers
      • Advanced Publishing Settings
      • Managing API Versions
      • Chapter Summary
    • Advanced API Technologies
      • API Technologies: Overview
      • GraphQL
      • gRPC
      • WebSocket
      • Socket.IO
      • Server-Sent Events (SSE)
      • SOAP
      • Chapter Summary
    • API Lifecycle
      • API Lifecycle: Overview
      • Stages of the API Lifecycle
      • API Governance
      • API Security Best Practices
      • Monitoring and Analytics
      • API Versioning Strategies
      • The Future of APIs
      • Chapter Summary
    • API Security
      • API Security: Overview
      • API Security Fundamentals
      • Authentication vs Authorization
      • Understanding OAuth 2.0 and OpenID Connect
      • JSON Web Tokens (JWT)
      • OWASP API Security Top 10
      • Encryption and HTTPS
      • Chapter Summary
    • API Tools
      • API Tools: Overview
      • The Evolution of API Tools
      • API Clients
      • Command Line Tools (cURL, HTTPie)
      • API Design and Documentation Tools
      • API Mocking Tools
      • API Testing Tools
      • All-in-One API Platforms
      • Chapter Summary
    • API Gateway
      • API Gateway: Overview
      • What is an API Gateway?
      • Key Features of API Gateways
      • API Gateway vs Load Balancer vs Service Mesh
      • Popular API Gateway Solutions
      • The BFF (Backend for Frontend) Pattern
      • Chapter Summary
  • Modern Pet Store
    • Pet
      • Get Pet
      • Update Pet
      • Delete Pet
      • Create Pet
      • List Pets
      • Upload Pet Image
    • User
      • Update User
      • Get User
      • Delete User
      • Login
      • Logout
      • Create User
    • Store
      • List Inventory
      • Create Order
      • Get Order
      • Delete Order
      • Callback Example
      • Pay for an Order
    • Payments
      • Pay Order
    • Chat
      • Create Chat Completion
    • Webhooks
      • Pet Adopted Event
      • New Pet Available Event
  • Schemas
    • Pet
    • Category
    • User
    • ApiResponse
    • OrderPayment
    • Tag
    • Order
    • Links-Order
    • PetCollection
    • Bank Card
    • Bank Account
    • Links
    • Error
HomePetstore APIExplore more APIs
HomePetstore APIExplore more APIs
🌐 English
  • 🌐 English
  • 🌐 繁體中文
🌐 English
  • 🌐 English
  • 🌐 繁體中文
  1. Developing APIs

Setup: Install Your AI Coding Assistant

Before you can generate code from your API design, you need the right tools. In this chapter, you'll install an AI-powered code editor that can transform your OpenAPI specification into a working API.
This takes about 15 minutes. By the end, you'll have a professional development environment ready to go.

Choosing Your AI Assistant#

You have two excellent options, and honestly, you can't go wrong with either. The main difference is pricing.
Cursor is what most professional developers use. It has the most polished experience, particularly its "Composer" mode which can generate entire projects from scratch. You get a free trial period (usually 2 weeks), then it's $20/month. If you're serious about development, it's worth it.
Windsurf is completely free and offers similar capabilities through its "Cascade" mode. It's built by Codeium, a well-established company in the AI coding space. The experience is nearly as good as Cursor, and it's free.
Recommendation: start with Windsurf. If you find yourself coding a lot and want the absolute best experience, switch to Cursor later. You can always change your mind.

Installing Windsurf (Free Option)#

Step 1: Download
Go to codeium.com/windsurf and click the download button for your operating system. The installer is about 100MB.
Step 2: Install
macOS: Open the downloaded .dmg file and drag Windsurf to your Applications folder
Windows: Run the installer and follow the prompts (it's straightforward)
Linux: Extract the archive and run the install script
Step 3: First Launch
Open Windsurf. You'll see a welcome screen asking you to create a free account. Use your email or sign in with GitHub/Google. This takes about 30 seconds.
Step 4: Quick Settings
The default settings work fine, but if you want to customize:
Theme: Click the gear icon β†’ Theme β†’ pick your preference
Font size: Settings β†’ Editor β†’ Font Size (we recommend 14)
Auto-save: Settings β†’ Files β†’ Auto Save β†’ set to "afterDelay"
That's it. Windsurf is ready.

Installing Cursor (Paid Option)#

Step 1: Download
Visit cursor.sh and download the installer for your system. It's about 150MB.
Step 2: Install
macOS: Open the .dmg and drag to Applications
Windows: Run the .exe installer
Linux: Use the provided AppImage or .deb package
Step 3: Start Your Trial
Launch Cursor and create an account. You'll get a free trial period (check their website for current offer, usually 2 weeks). No credit card required for the trial.
Step 4: Configure
Cursor works great out of the box, but here are some useful tweaks:
Enable Composer: Settings β†’ Features β†’ Composer (should be on by default)
Set your preferred model: Settings β†’ Models β†’ choose GPT-4 or Claude (Claude Sonnet 3.5 is excellent)
Privacy: Settings β†’ Privacy β†’ decide if you want to share anonymous usage data
You're ready to go.

Verifying Your Installation#

Let's make sure everything works. This is the same for both Cursor and Windsurf.
Create a test project:
1.
Open your AI editor
2.
Click "Open Folder" or File β†’ Open Folder
3.
Create a new folder somewhere (like Desktop/api-test)
4.
Select that folder
Test the AI assistant:
1.
Press Cmd+L (Mac) or Ctrl+L (Windows/Linux) to open the chat panel
2.
Type: "Create a simple hello world Python script"
3.
Press Enter
You should see the AI generate a Python script. If it does, everything is working perfectly. If not, check that:
You're connected to the internet
You're logged into your account
The AI panel is actually open (check the sidebar)
For Cursor users - test Composer:
1.
Press Cmd+I (Mac) or Ctrl+I (Windows/Linux)
2.
This opens Composer mode
3.
Type: "Create a basic FastAPI project structure"
4.
Watch it generate multiple files
For Windsurf users - test Cascade:
1.
Click the Cascade icon in the sidebar (looks like a waterfall)
2.
Type: "Create a basic FastAPI project structure"
3.
It should generate multiple files
If you can generate code, you're all set.

Installing Python#

You'll need Python to actually run the API code that gets generated. Here's the quickest way to get it installed.
Check if you already have it:
Open your terminal (Terminal on Mac/Linux, PowerShell on Windows) and type:
If you see something like "Python 3.10.x" or higher, you're good. Skip to the next section.
If you don't have Python 3.10+:
macOS:
The easiest way is with Homebrew. If you don't have Homebrew, install it first:
Then install Python:
Windows:
1.
Go to python.org/downloads
2.
Download Python 3.11 or 3.12
3.
Run the installer
4.
Important: Check "Add Python to PATH" during installation
Linux (Ubuntu/Debian):
Verify installation:
Both commands should work and show version numbers.

Understanding Your New Tools#

Now that everything is installed, here's what you actually have:
Your AI coding assistant (Cursor or Windsurf) is a code editor with AI built in. Think of it as VS Code, but the AI can see your entire project, understand context, and generate or modify code across multiple files at once. It's not just autocomplete.
When you feed it your OpenAPI specification and ask it to build an API, it understands:
The structure of a web API project
How to set up routing based on your endpoints
What libraries to use for authentication, validation, etc.
How to connect to databases
Common patterns and best practices
The quality is surprisingly good. It won't be perfect, but it'll give you working code that you can understand, test, and modify.
Python is the programming language we'll use. If you've never written Python before, don't worry. The AI writes the code, and Python is one of the more readable languages. You'll pick it up as you go.

First Experience Tips#

Start small. When you first use the AI, don't try to generate your entire API at once. Ask it to explain something simple first. Get comfortable with how it works.
Ask questions. If the AI generates code you don't understand, ask it to explain. "What does this function do?" or "Why do we need this library?" It's surprisingly good at teaching.
Don't trust it blindly. The AI makes mistakes. Always test the code it generates. That's why we have Apidog - to verify everything actually works.
Iterate. If you don't like something it generated, ask it to change it. "Make this simpler" or "Add error handling here" works well.
Save your work. Both editors have auto-save, but get in the habit of using version control (we'll cover this later).

What's Next#

You now have:
βœ“ AI coding assistant installed and working
βœ“ Python installed and verified
βœ“ Basic understanding of how these tools work
Next up, you'll export your API design from Apidog and generate your first complete project. This is where it gets exciting.
Continue with β†’ Quick Start: Generate Your API in 30 Minutes
Modified atΒ 2025-12-29 10:42:25
Previous
Developing APIs: Overview
Next
Quick Start: From Spec to Running API in 30 Minutes
Built with