Add aimlapi.com API support #1866

Closed
opened 2025-11-11 14:55:05 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @EngYasserSharaf on GitHub (Aug 23, 2024).

I have an APi key from https://aimlap.com and their API endpoint doesn't end with v1 I tried to add their endpoint url and my API key but it couldn't list the models in the workspace page

Their code from the docs

const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
  apiKey: "YOUR_API_KEY",
  basePath: "https://api.aimlapi.com/",
});
const openai = new OpenAIApi(configuration);
async function run() {
  const response = await openai.createCompletion({
    model: "mistralai/Mistral-7B-Instruct-v0.2",
    prompt: "Tell me a joke",
    max_tokens: 50,
  });
  console.log(response.data.choices[0].text);
}
run();

Screenshot_2024-08-22_181219

So their API url is https://api.aimlapi.com/ and I found out that in the network tab it could list the models successfully

Screenshot_2024-08-22_180019

but when I go to workspace and check the models, I get nothing.

Originally created by @EngYasserSharaf on GitHub (Aug 23, 2024). I have an APi key from https://aimlap.com and their API endpoint doesn't end with `v1` I tried to add their endpoint url and my API key but it couldn't list the models in the workspace page Their code from the docs ``` const { Configuration, OpenAIApi } = require("openai"); const configuration = new Configuration({ apiKey: "YOUR_API_KEY", basePath: "https://api.aimlapi.com/", }); const openai = new OpenAIApi(configuration); async function run() { const response = await openai.createCompletion({ model: "mistralai/Mistral-7B-Instruct-v0.2", prompt: "Tell me a joke", max_tokens: 50, }); console.log(response.data.choices[0].text); } run(); ``` ![Screenshot_2024-08-22_181219](https://github.com/user-attachments/assets/16892827-6f7f-4629-8b90-85637e69d018) So their API url is `https://api.aimlapi.com/` and I found out that in the network tab it could list the models successfully ![Screenshot_2024-08-22_180019](https://github.com/user-attachments/assets/74423b5b-f6dc-4edd-ac41-9e2b719368a6) but when I go to workspace and check the models, I get nothing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#1866