1. Create an API key
Sign in to the Xinfeng console and create a key in the wallet or API key area. Treat the key as a secret: do not put it in client-side code, screenshots or public repositories.
Keep the key in an environment variable. The examples below use XINFENG_API_KEY and never contain a real credential.
2. Use the OpenAI-compatible base URL
For chat, image and other OpenAI-compatible routes, use https://xinfeng.best/v1 as the base URL.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["XINFENG_API_KEY"],
base_url="https://xinfeng.best/v1",
)
response = client.chat.completions.create(
model="grok-4.7",
messages=[{"role": "user", "content": "Explain async video APIs in three bullets."}],
)
print(response.choices[0].message.content)
The OpenAI SDK is convenient, but a plain HTTPS request is also valid. Model availability is checked by the API after authentication.
3. Inspect the model catalog
Public family pages in this hub show a dated catalog snapshot. For the authenticated list available to your key, call GET /v1/models with the same bearer token.
curl https://xinfeng.best/v1/models \
-H "Authorization: Bearer $XINFENG_API_KEY"4. Submit video jobs asynchronously
Video is a task lifecycle, not a single blocking response. Send the request with an idempotency key, store the returned task ID, and poll the original task until it is terminal.