# Native Claude Format Source: https://docs.ai.cc/api-reference/endpoint/chat/claude api-reference/openapi.json post /v1/messages Requests must be in the Anthropic Claude Messages API format. The request header must include `anthropic-version`. This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at [Claude Docs](https://platform.claude.com/docs/en/build-with-claude/working-with-messages). # Gemini Text Chat Source: https://docs.ai.cc/api-reference/endpoint/chat/gemini api-reference/openapi.json post /v1beta/models/{model}:generateContent Gemini Generate Content This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at [Gemini Docs](https://ai.google.dev/gemini-api/docs/text-generation). # OpenAI Responses Format Source: https://docs.ai.cc/api-reference/endpoint/chat/openai api-reference/openapi.json post /v1/responses The OpenAI Responses API is used to create model responses. It supports multi-turn dialogue, tool calls, inference, and other functionalities. This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at [OpenAI Docs](https://platform.openai.com/docs/api-reference/responses/create). # Native OpenAI Format Source: https://docs.ai.cc/api-reference/endpoint/completion/index api-reference/openapi.json post /v1/chat/completions Creates model responses based on conversation history. Supports both streaming and non-streaming responses. Compatible with the OpenAI Chat Completions API. This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at [OpenAI Docs](https://platform.openai.com/docs/api-reference/chat/create). # Volcengine Images Source: https://docs.ai.cc/api-reference/endpoint/image/doubao api-reference/endpoint/image/doubao_openapi.json post /v1/images/generations This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at [Volcengine Docs](https://www.volcengine.com/docs/82379/1541523). # Gemini Images Source: https://docs.ai.cc/api-reference/endpoint/image/gemini api-reference/endpoint/image/gemini_openapi.json post /v1beta/models/{model}:generateContent This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at [Gemini Docs](https://ai.google.dev/gemini-api/docs/image-generation). # Generate Images Source: https://docs.ai.cc/api-reference/endpoint/image/openai-create api-reference/endpoint/image/openai_openapi.json post /v1/images/generations This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at [OpenAI Docs](https://platform.openai.com/docs/api-reference/images/create). # Edit Image Source: https://docs.ai.cc/api-reference/endpoint/image/openai-update api-reference/endpoint/image/openai_openapi.json post /v1/images/edits This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at [OpenAI Docs](https://platform.openai.com/docs/api-reference/images/createEdit). # Generate Images Source: https://docs.ai.cc/api-reference/endpoint/image/qwen-create api-reference/endpoint/image/qwen_openapi.json post /v1/images/generations Image generation for the qwen-image/wan series This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at [Qwen Docs](https://help.aliyun.com/zh/model-studio/models?spm=a2c4g.11186623.0.0.59d7130crsmz2F#4611ffaa38hnp). # Edit Image Source: https://docs.ai.cc/api-reference/endpoint/image/qwen-update api-reference/endpoint/image/qwen_openapi.json post /v1/images/edits qwen-image series image generator This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at [Qwen Docs](https://help.aliyun.com/zh/model-studio/models?spm=a2c4g.11186623.0.0.59d7130crsmz2F#4611ffaa38hnp). # Native OpenAI Format Source: https://docs.ai.cc/api-reference/endpoint/model/models api-reference/openapi.json get /v1/models Retrieves a list of currently available models. The return format is automatically determined based on the request headers: - Returns Anthropic format when `x-api-key` and `anthropic-version` headers are included. - Returns Gemini format when `x-goog-api-key` header or `key` query parameter is included. - Returns OpenAI format in other cases. # Native Gemini Format Source: https://docs.ai.cc/api-reference/endpoint/model/models-gemini api-reference/openapi.json get /v1beta/models Return a list of available models in Gemini API format. # Translate Source: https://docs.ai.cc/api-reference/endpoint/translate/index api-reference/openapi.json post /v1/aicc/aicc-translator text translate # Create Video Generation Task Source: https://docs.ai.cc/api-reference/endpoint/video/create api-reference/openapi.json post /v1/video/generations Using models from different platforms requires passing their respective parameters. Please refer to: * [Wan](https://help.aliyun.com/zh/model-studio/models) * [Volcengine](https://www.volcengine.com/docs/82379/1520757) # Get Video Generation Task Status Source: https://docs.ai.cc/api-reference/endpoint/video/result api-reference/openapi.json get /v1/video/generations/{task_id} # Create Video Source: https://docs.ai.cc/api-reference/endpoint/video/sora/createvideo api-reference/openapi.json post /v1/videos OpenAI-compatible video generation API. Reference documentation: https://platform.openai.com/docs/api-reference/videos/create # Get Video Task Status Source: https://docs.ai.cc/api-reference/endpoint/video/sora/getvideo api-reference/openapi.json get /v1/videos/{task_id} OpenAI-compatible video task status query interface. Returns detailed status information for video tasks. # Get Video Content Source: https://docs.ai.cc/api-reference/endpoint/video/sora/getvideocontent api-reference/openapi.json get /v1/videos/{task_id}/content Retrieves the video file content for a completed video task. This interface proxies and returns the video file stream. # Introduction Source: https://docs.ai.cc/api-reference/introduction AICC API Full Interface Documentation ## Overview This API reference describes the RESTful, streaming, and realtime APIs you can use to interact with the AICC platform. REST APIs are usable via HTTP in any environment that supports HTTP requests. ## Authentication The AICC API uses API keys for authentication. Create, manage, and learn more about API keys in [your account page](https://api.ai.cc/console/token). **Remember that your API key is a secret!** Do not share it with others or expose it in any client-side code (browsers, apps). API keys should be securely loaded from an environment variable or key management service on the server. API keys should be provided via [HTTP Bearer authentication](https://swagger.io/docs/specification/v3_0/authentication/bearer-authentication/). ``` Authorization: Bearer YOUR_AICCAPI_KEY ``` ## AI Model APIs AI Model APIs provide calls for various AI capabilities, compatible with the [OpenAI API](https://platform.openai.com/docs/api-reference) format. Get a list of available models. Conversation completion API. Traditional text completion API. AI image generation API. AI video generation API. Traditional text completion API. # Quickstart Source: https://docs.ai.cc/guides/quickstart A step-by-step guide to setting up and making a test call to the AI model, including generating an API key, configuring the Base URL, and running the first request. Here, you'll learn how to start using our API in your code. The following steps must be completed regardless of whether you integrate one of the [models](https://api.ai.cc/pricing) we offer or use our ready-made solution: * [generating an AICC API Key](#generating-an-aicc-api-key) * [configuring the base URL](#configuring-base-url) * [making an API call](#making-an-api-call) Let's walk through an example of connecting to the gpt-4o model via OpenAI SDK. This guide is suitable even for complete beginners. ## Generating an AICC API Key You can find your AICC API key on the [account page](https://api.ai.cc/console/token). An AICC API Key is a credential that grants you access to our API from within your code. It is a sensitive string of characters that should be kept confidential. Do not share this API key with anyone else, as it could be misused without your knowledge. ⚠️ Note that API keys from third-party organizations cannot be used with our API: you need an AICC API Key. To use the AICC API, you need to create an account and generate an API key. Follow these steps: 1. Create an Account: Visit the [AICC API website](https://api.ai.cc/register) and create an account. 2. Generate an API Key: After logging in, navigate to your [account dashboard](https://api.ai.cc/console/token) and generate your API key. Ensure that key is enabled on UI. ## Configuring Base URL The **Base URL** is the first part of the URL (including the protocol, domain, and pathname) that determines the server responsible for handling your request. It’s crucial to configure the correct Base URL in your application, especially if you are using SDKs from OpenAI, Azure, or other providers. By default, these SDKs are set to point to their servers, which are not compatible with our API keys and do not support many of the models we offer. Depending on your environment and application, you will set the base URL differently. Below is a universal string that you can use to access our API. Copy it or return here later when you are ready with your environment or app. ``` https://api.ai.cc ``` The AICC API supports both versioned and non-versioned URLs, providing flexibility in your API requests. You can use either of the following formats: * `https://api.ai.cc` * `https://api.ai.cc/v1` Using versioned URLs can help ensure compatibility with future updates and changes to the API. It is recommended to use versioned URLs for long-term projects to maintain stability. ## Making an API Call Based on your environment, you will call our API differently. Below are two common ways to call our API using two popular programming languages: **Python** and **NodeJS**. In the examples below, we use the [OpenAI SDK](https://platform.openai.com/docs/libraries). This is possible due to our compatibility with most OpenAI APIs, but this is just one approach. You can use our API without this SDK with raw HTTP queries. If you don’t want lengthy explanations, here’s the code you can use right away in a Python or Node.js program. You only need to replace `` with your AICC API Key obtained from your account. However, below, we will still go through these examples step by step in both languages explaining every single line. ```python Python theme={null} from openai import OpenAI base_url = "https://api.ai.cc/v1" # Insert your AICC API key in the quotation marks instead of : api_key = "" system_prompt = "You are a travel agent. Be descriptive and helpful." user_prompt = "Tell me about San Francisco" api = OpenAI(api_key=api_key, base_url=base_url) def main(): completion = api.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt}, ], temperature=0.7, max_tokens=256, ) response = completion.choices[0].message.content print("User:", user_prompt) print("AI:", response) if __name__ == "__main__": main() ``` ```javascript NodeJS theme={null} const { OpenAI } = require("openai"); const baseURL = "https://api.ai.cc/v1"; // Insert your AICC API Key in the quotation marks instead of my_key: const apiKey = ""; const systemPrompt = "You are a travel agent. Be descriptive and helpful"; const userPrompt = "Tell me about San Francisco"; const api = new OpenAI({ apiKey, baseURL, }); const main = async () => { const completion = await api.chat.completions.create({ model: "mistralai/Mistral-7B-Instruct-v0.2", messages: [ { role: "system", content: systemPrompt, }, { role: "user", content: userPrompt, }, ], temperature: 0.7, max_tokens: 256, }); const response = completion.choices[0].message.content; console.log("User:", userPrompt); console.log("AI:", response); }; main(); ``` Let's start from very beginning. We assume you already installed Python (with venv) Create a new folder for test project, name it as `aiccapi-welcome` and change to it. ``` mkdir ./aiccapi-welcome cd ./aiccapi-welcome ``` (Optional) If you use IDE then we recommend to open created folder as workspace. On example, in VSCode you can do it with: ``` code . ``` Run a terminal inside created folder and create virtual envorinment with a command ``` python3 -m venv ./.venv ``` Activate created virtual environment ``` # Linux / Mac source ./.venv/bin/activate # Windows ./.venv/bin/Activate.bat ``` Install requirement dependencies. In our case we need only OpenAI SDK ``` pip install openai ``` Create new file and name it as `travel.py` ``` touch travel.py ``` Paste following content inside this `travel.py` and replace `` with your API key you got on [first step](#generating-an-aicc-api-key). ```python theme={null} from openai import OpenAI base_url = "https://api.ai.cc/v1" # Insert your AICC API key in the quotation marks instead of : api_key = "" system_prompt = "You are a travel agent. Be descriptive and helpful." user_prompt = "Tell me about San Francisco" api = OpenAI(api_key=api_key, base_url=base_url) def main(): completion = api.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt}, ], temperature=0.7, max_tokens=256, ) response = completion.choices[0].message.content print("User:", user_prompt) print("AI:", response) if __name__ == "__main__": main() ``` Run the application ``` python3 ./travel.py ``` If you done all correct, you will see following output: ``` User: Tell me about San Francisco AI: San Francisco, located in northern California, USA, is a vibrant and culturally rich city known for its iconic landmarks, beautiful vistas, and diverse neighborhoods. It's a popular tourist destination famous for its iconic Golden Gate Bridge, which spans the entrance to the San Francisco Bay, and the iconic Alcatraz Island, home to the infamous federal prison. The city's famous hills offer stunning views of the bay and the cityscape. Lombard Street, the "crookedest street in the world," is a must-see attraction, with its zigzagging pavement and colorful gardens. Ferry Building Marketplace is a great place to explore local food and artisanal products, and the Pier 39 area is home to sea lions, shops, and restaurants. San Francisco's diverse neighborhoods each have their unique character. The historic Chinatown is the oldest in North America, while the colorful streets of the Mission District are known for their murals and Latin American culture. The Castro District is famous for its LGBTQ+ community and vibrant nightlife. ``` As in the example from Python, we start from the very beginning too. We assume you already have Node.js installed We need to create a new folder for the example project: ``` mkdir ./aiccapi-welcome cd ./aiccapi-welcome ``` (Optional) If you use IDE then we recommend to open created folder as workspace. On example, in VSCode you can do it with: ``` code . ``` Now create a project file: ``` npm init -y ``` Install the required dependencies: ``` npm i openai ``` Create a file with the source code: ``` touch ./index.js ``` And paste the following content: ```javascript theme={null} const { OpenAI } = require("openai"); const baseURL = "https://api.ai.cc/v1"; // Insert your AICC API Key in the quotation marks instead of my_key: const apiKey = ""; const systemPrompt = "You are a travel agent. Be descriptive and helpful"; const userPrompt = "Tell me about San Francisco"; const api = new OpenAI({ apiKey, baseURL, }); const main = async () => { const completion = await api.chat.completions.create({ model: "mistralai/Mistral-7B-Instruct-v0.2", messages: [ { role: "system", content: systemPrompt, }, { role: "user", content: userPrompt, }, ], temperature: 0.7, max_tokens: 256, }); const response = completion.choices[0].message.content; console.log("User:", userPrompt); console.log("AI:", response); }; main(); ``` You will see a response that looks like this: ``` User: Tell me about San Francisco AI: San Francisco, located in the northern part of California, USA, is a vibrant and culturally rich city known for its iconic landmarks, beautiful scenery, and diverse neighborhoods. The city is famous for its iconic Golden Gate Bridge, an engineering marvel and one of the most recognized structures in the world. Spanning the Golden Gate Strait, this red-orange suspension bridge connects San Francisco to Marin County and offers breathtaking views of the San Francisco Bay and the Pacific Ocean. ``` ## Code Explanation Both examples are written in different programming languages, but despite that, they look very similar. Let's break down the code step by step and see what's going on. In the examples above, we are using the OpenAI SDK. The OpenAI SDK is a nice module that allows us to use the AICC API without dealing with repetitive boilerplate code for handling HTTP requests. Before we can use the OpenAI SDK, it needs to be imported. The import happens in the following places: ```python Python theme={null} from openai import OpenAI ``` ```javascript NodeJS theme={null} const { OpenAI } = require("openai"); ``` Simple as it is. The next step is to initialize variables that our code will use. The two main ones are: the base URL and the API key. We already discussed them at the beginning of the article. ```python Python theme={null} base_url = "https://api.ai.cc/v1" api_key = "" system_prompt = "You are a travel agent. Be descriptive and helpful." user_prompt = "Tell me about San Francisco" ``` ```javascript NodeJS theme={null} const baseURL = "https://api.ai.cc/v1"; const apiKey = ""; const systemPrompt = "You are a travel agent. Be descriptive and helpful"; const userPrompt = "Tell me about San Francisco"; ``` To communicate with LLM models, users use texts. These texts are usually called "Prompts." Inside our code, we have prompts with two roles: the system and the user. The system prompt is designed to be the main source of instruction for LLM generation, while the user prompt is designed to be user input, the subject of the system prompt. Despite that many models can operate differently, this behavior usually applies to chat LLM models, currently one of the most useful and popular ones. Inside the code, the prompts are called in variables `systemPrompt`, `userPrompt` in JS, and `system_prompt`, `user_prompt` in Python. Before we use the API, we need to create an instance of the OpenAI SDK class. It allows us to use all their methods. The instance is created with our imported package, and here we forward two main parameters: the base URL and the API key. ```python Python theme={null} api = OpenAI(api_key=api_key, base_url=base_url) ``` ```javascript NodeJS theme={null} const api = new OpenAI({ apiKey, baseURL, }); ``` Because of notation, these two parameters are called slightly differently in these different languages (camel case in JS and snake case in Python), but their functionality is the same. All preparation steps are done. Now we need to write our functionality and create something great. In the examples above, we make the simplest travel agent. Let's break down the steps of how we send a request to the model. The best practice is to split the code blocks into complete parts with their own logic and not place executable code inside global module code. This rule applies in both languages we discuss. So we create a main function with all our logic. In JS, this function needs to be async, due to Promises and simplicity. In Python, requests run synchronously. The OpenAI SDK provides us with methods to communicate with chat models. It is placed inside the `chat.completions.create` function. This function accepts multiple parameters but requires only two: `model` and `messages`. `model` is a string, the name of the model that you want to use. For the best results, use a model designed for chat, or you can get unpredictable results if the model is not fine-tuned for that purpose. A list of supported models can be found here. `messages` is an array of objects with a `content` field as prompt and a `role` string that can be one of `system`, `user`, `tool`, `assistant`. With the `role`, the model can understand what to do with this prompt: Is this an instruction? Is this a user message? Is this an example of how to answer? Is this the result of code execution? The tool role is used for more complex behavior and will be discussed in another article. In our example, we also use `max_tokens` and `temperature`. With that knowledge, we can now send our request like the following: ```python Python theme={null} completion = api.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt}, ], temperature=0.7, max_tokens=256, ) ``` ```javascript NodeJS theme={null} const completion = await api.chat.completions.create({ model: "gpt-4o", messages: [ { role: "system", content: systemPrompt, }, { role: "user", content: userPrompt, }, ], temperature: 0.7, max_tokens: 256, }); ``` The response from the function chat.completions.create contains a completion. Completion is a fundamental part of LLM models' logic. Every LLM model is some sort of word autocomplete engine, trained by huge amounts of data. The chat models are designed to autocomplete large chunks of messages with prompts and certain roles, but other models can have their own custom logic without even roles. Inside this completion, we are interested in the text of the generation. We can get it by getting the result from the completion variable: ```python Python theme={null} response = completion.choices[0].message.content ``` ```javascript NodeJS theme={null} const response = completion.choices[0].message.content; ``` In certain cases, completion can have multiple results. These results are called choices. Every choice has a message, the product of generation. The string content is placed inside the `content` variable, which we placed inside our response variable above. In the next steps, we can finally see the results. In both examples, we print the user prompt and response like it was a conversation: ```python Python theme={null} print("User:", user_prompt) print("AI:", response) ``` ```javascript NodeJS theme={null} console.log("User:", userPrompt); console.log("AI:", response); ``` Voila! Using AICC API models is the simplest and most productive way to get into the world of Machine Learning and Artificial Intelligence. # Documentation Map Source: https://docs.ai.cc/index Learn how to get started with the AICC API ## Setting up This page helps you quickly find the right AI model or ready-to-use solution for your task. Open the API reference and copy a working example to integrate it into your code in minutes. Follow our three step quickstart guide. ## Browse models Popular Select the model by its Task, by its Developer or by the supported Capabilities View all 100+ models.