Skip to content

Ve-ria/ami.2api

Repository files navigation

Ami.2api

好吧如你所见这是一个Ami.2api, 能用就行. 使用OpenAI标准格式, 好像支持reasoning...

apikey = <session_token>;<projectid>
fetch("https://app.ami.dev/api/v1/trpc/user.session.get", {
  method: "GET",
  headers: {
    "Content-Type": "application/json"
  }
})
  .then((response) => response.json())
  .then((data) => {
    console.log(data['result']['data']['session_token']);
  })
  .catch(() => {
    console.log(null);
  });

fetch("https://app.ami.dev/api/v1/trpc/projects.create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "cwd": "C:\\\\Users",
    "title": "C:\\\\Users"
  })
})
  .then((response) => response.json())
  .then((data) => {
    console.log(data['result']['data']['projectId']);
  })
  .catch(() => {
    console.log(null);
  });

使用这段JS以获取Token以及ProjectID, 第一个输出的是token, 第二个是projectID, 把他们用分号连起来就可以当作APIKEY用了.

PORT以指定端口. 默认3000

无其他环境变量要求.

支持Docker:

docker pull ghcr.io/ve-ria/ami.2api:ref-main

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors