Generating an AICC API Key
What is an API Key?
What is an API Key?
You can find your AICC API key on the account page.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.
- Create an Account: Visit the AICC API website and create an account.
- Generate an API Key: After logging in, navigate to your account dashboard and generate your API key. Ensure that key is enabled on UI.
Configuring Base URL
What is a Base URL?
What is a 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.
https://api.ai.cchttps://api.ai.cc/v1
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. 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.
<YOUR_AICCAPI_KEY> 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.
Step-by-step example in Python
Step-by-step example in Python
Let’s start from very beginning. We assume you already installed Python (with venv)Create a new folder for test project, name it as (Optional) If you use IDE then we recommend to open created folder as workspace. On example, in VSCode you can do it with:Run a terminal inside created folder and create virtual envorinment with a commandActivate created virtual environmentInstall requirement dependencies. In our case we need only OpenAI SDKCreate new file and name it as Paste following content inside this Run the applicationIf you done all correct, you will see following output:
aiccapi-welcome and change to it.travel.pytravel.py and replace <YOUR_AICCAPI_KEY> with your API key you got on first step.Step-by-step example in NodeJS
Step-by-step example in NodeJS
As in the example from Python, we start from the very beginning too. We assume you already have Node.js installedWe need to create a new folder for the example project:(Optional) If you use IDE then we recommend to open created folder as workspace. On example, in VSCode you can do it with:Now create a project file:Install the required dependencies:Create a file with the source code:And paste the following content:You will see a response that looks like this:
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: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.
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:
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:

