API Reference
Endpoints, request formats, and response schemas.
OhMyGPT provides an OpenAI-compatible API. If you have existing code that uses the OpenAI API, you can switch to OhMyGPT by changing the base URL.
Base configuration
| Item | Value |
|---|---|
| Base URL | https://api.ohmygpt.com/v1 |
| Authentication | Authorization: Bearer $OHMYGPT_API_KEY |
| Content-Type | application/json |
Supported endpoints
| Endpoint | Description |
|---|---|
POST /chat/completions | Generate chat completions (text, tool calls) |
POST /messages | Anthropic Messages API (Claude) |
Guides
Endpoint Reference
Alternative endpoints
For users in different regions:
| Endpoint | Description |
|---|---|
https://api.ohmygpt.com | Direct US server |
https://apic.ohmygpt.com | Cloudflare CDN (global) |
https://c-z0-api-01.hash070.com | China-optimized CDN |
How is this guide?
Last updated on
