OpenAPI Specification
Download and use the OpenAPI 3.1 specification for the CourseForge API
The CourseForge API is fully documented using the OpenAPI 3.1 specification standard. This allows you to generate client libraries, validate requests, and integrate with API development tools.
OpenAPI (formerly Swagger) is an industry-standard specification for describing RESTful APIs. It enables automatic SDK generation, documentation, and testing tools.
Accessing the Specification
Download OpenAPI JSON
/api/openapi - OpenAPI 3.1.0 specification
Interactive Documentation
/api/reference - Powered by Scalar
Generating Client SDKs
Use the OpenAPI specification to generate type-safe client libraries in your preferred language.
TypeScript SDK
Using openapi-typescript
# Install the generator npm install -D openapi-typescript # Generate TypeScript types npx openapi-typescript https://courseforge.caringai.app/api/openapi \ -o ./src/types/api.ts # Use in your code import type { paths } from './types/api' type CourseResponse = paths['/api/v1/courses']['get']['responses']['200']['content']['application/json']
JavaScript/TypeScript SDK
Using @hey-api/openapi-ts
# Install the generator npm install -D @hey-api/openapi-ts # Generate client SDK npx @hey-api/openapi-ts \ -i https://courseforge.caringai.app/api/openapi \ -o ./src/api-client \ -c @hey-api/client-fetch # Use in your code import { CoursesService } from './api-client' const courses = await CoursesService.listCourses({ page: 1, per_page: 20 })
Python SDK
Using openapi-generator-cli
# Install the generator npm install -g @openapitools/openapi-generator-cli # Generate Python client openapi-generator-cli generate \ -i https://courseforge.caringai.app/api/openapi \ -g python \ -o ./courseforge-client \ --package-name courseforge # Use in your code from courseforge import ApiClient, CoursesApi from courseforge.configuration import Configuration config = Configuration() config.api_key['ApiKeyAuth'] = 'cf_prod_your_key' config.host = 'https://courseforge.caringai.app/api/v1' with ApiClient(config) as client: api = CoursesApi(client) courses = api.list_courses(page=1, per_page=20)
API Development Tools
Postman
Import the OpenAPI specification directly into Postman:
- Open Postman
- Click "Import"
- Select "Link" and paste:
https://courseforge.caringai.app/api/openapi
- Click "Continue" to import all endpoints
- Configure authentication with your API key
Insomnia
Import the spec into Insomnia REST client:
- Open Insomnia
- Click "Create" → "Import from URL"
- Paste:
https://courseforge.caringai.app/api/openapi
- All endpoints will be added to your workspace
VS Code
Use the OpenAPI extension for VS Code:
- Install the "OpenAPI (Swagger) Editor" extension
- Download the spec:
curl https://courseforge.caringai.app/api/openapi > openapi.json
- Open the file in VS Code for syntax highlighting and validation
Specification Details
Validation & Testing
Command Line Validation
Using Redocly CLI
npx @redocly/cli lint https://courseforge.caringai.app/api/openapi
Online Validation
Using Swagger Editor
- Visit: https://editor.swagger.io
- Click File → Import URL
- Paste the OpenAPI URL
- Review validation results and errors
Schema Updates
The OpenAPI specification is automatically updated when new endpoints are added.
The spec is cached for 1 hour to improve performance.
Add ?cache=false
to the OpenAPI URL to bypass caching during development:/api/openapi?cache=false