G4F API

From H4KS
Revision as of 17:36, 30 April 2026 by Mattf (talk | contribs) (Created G4F API wiki page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

G4F API[edit]

The G4F API is a free, open-source AI text completion API provided by H4ks. It serves as an alternative API for getting text completions from various AI models and providers, powered by the g4f project.

Features[edit]

  • Free text completions from multiple AI models
  • OpenAPI/Swagger documentation
  • RESTful API endpoint
  • Compatible with OpenAI API format

API Endpoint[edit]

Example Usage[edit]

<source lang="bash"> curl -X POST https://g4f.h4ks.com/api/completions \

 -H "Content-Type: application/json" \
 -d '{"prompt": "Hello, world!", "model": "gpt-4"}'

</source>

Links[edit]