Overview
The NanoGPT API offers multiple ways to generate text, including OpenAI-compatible endpoints and our legacy options. This guide covers all available text generation methods. If you are using a TEE-backed model (e.g., prefixed withTEE/
), you can also verify the enclave attestation and signatures for your chat completions. See the TEE Model Verification guide for more details.
OpenAI Compatible Endpoints
Chat Completions (v1/chat/completions)
This endpoint mimics OpenAI’s chat completions API:Text Completions (v1/completions)
This endpoint mimics OpenAI’s legacy text completions API:Legacy Text Completions
For the older, non-OpenAI compatible endpoint:Chat Completions with Cache Control (Claude Models)
For Claude models, you can enable caching to improve performance and reduce costs for repeated conversations. 5m cache costs 1.25x, 1h costs 2x on initial message, both give a 90% discount after.Chat Completions with Web Search
Enable real-time web access for any model by appending special suffixes:Web Search Options
:online
- Standard search with 10 results ($0.006 per request):online/linkup-deep
- Deep iterative search ($0.06 per request)