First API Call
Quick Start
Third-party applications can access various AI services provided by GeekAI through API interfaces. Currently, we offer AI model proxy, AI agent, file conversation, and OCR services (free), with more AI service interfaces to be gradually released in the future.
GeekAI API uses an OpenAI-compatible API format. By modifying configurations, you can use the OpenAI SDK to access GeekAI API, or use software that is compatible with OpenAI API (third-party application integration):
Parameter | Value |
---|---|
Base URL | |
API KEY |
Sometimes the Base URL cannot include the /v1
suffix, especially in some third-party applications. In such cases, you need to adjust the Base URL according to the actual situation. If including the /v1
suffix results in an error, try removing it.
After creating and copying your API key, you can use the following sample code to access GeekAI API. The example demonstrates non-streaming output; you can set stream
to true
to use streaming output:
The principle of streaming output is SSE (Server-Sent Events). When streaming output is enabled, the client-side code needs to be adapted to handle it. For example, in front-end code, you need to use EventSource to receive the streaming response from the server; otherwise, an error will occur.
Analyze image inputs
If you want to analyze images, you can use the following example code:
Developer Group
If you encounter any issues during implementation, you can join our developer group for assistance. We will answer your questions promptly:
In the group, you can receive the latest updates on GeekAI, technical sharing, product features, API usage, and other information.