This guide walks you through making your first API calls to GlobalAI OPC. By the end, you will have generated text with a GPT model, created an image with Nano Banana, and kicked off a Sora video generation — all using the same Bearer token authentication pattern.Documentation Index
Fetch the complete documentation index at: https://docs.xingchaoyiqing.com/llms.txt
Use this file to discover all available pages before exploring further.
Image and video generation are asynchronous. When you create a task, the API returns a task ID immediately. You must poll the result endpoint until the status changes to
completed before you can access the generated file.Get an API Key
Contact the GlobalAI OPC team to obtain your API key. Once you have it, store it securely — never hard-code it in source files or commit it to version control.Set your key as an environment variable so your code can read it without embedding it in plain text:
Make a Text Generation Call
Send a chat completion request to the text API endpoint. The endpoint is fully OpenAI-compatible, so any code or SDK that works with OpenAI’s A successful response looks like this:
chat/completions API works here with only a base URL change.Generate an Image
Submit an image generation request to the Nano Banana endpoint. The API returns a task ID immediately — you will poll for the result in the next step.The response confirms the task is queued:
Poll for the Image Result
Query the result endpoint with your task ID until the status is When the image is ready, the response includes the image URL:
completed. The completed response includes a direct URL to your generated image.Poll every 30–60 seconds. Polling too frequently can result in rate limiting and doesn’t speed up generation.
Generate a Video
Submit a video generation request to the Sora endpoint. Like image generation, this is asynchronous — the API returns a task ID that you poll until the video is ready.The response confirms the task is queued:Poll for the video result using the same result endpoint:When the video is ready, the completed response includes the video URL:
cURL
cURL
Next Steps
You’ve made your first text, image, and video generation calls. Explore the full API reference to discover all available models, parameters, and capabilities.Authentication
Learn how to manage API keys and protect them with environment variables and secrets managers.
API Reference
Browse every endpoint, request parameter, and response schema for all three API categories.