# iim-api
**Repository Path**: iimeta/iim-api
## Basic Information
- **Project Name**: iim-api
- **Description**: 智元 IIM 是一款开源的网页版即时聊天系统, 同时拥有AI聊天对话功能, 支持文心一言、讯飞星火、通义千问等AI助手功能
- **Primary Language**: Go
- **License**: MIT
- **Default Branch**: main
- **Homepage**: https://iim.ai
- **GVP Project**: No
## Statistics
- **Stars**: 3
- **Forks**: 5
- **Created**: 2023-10-27
- **Last Updated**: 2025-02-09
## Categories & Tags
**Categories**: Uncategorized
**Tags**: API, Go语言, 文心一言, 讯飞星火, 智元IIM
## README

# 智元 IIM API
[](https://github.com/iimeta/iim-api/releases)
[](https://github.com/iimeta/iim-api/blob/main/LICENSE)
[](https://goreportcard.com/report/github.com/iimeta/iim-api)
`智元 IIM` 是一款开源的网页版即时聊天系统, 同时拥有AI聊天对话功能, 本项目基于[Lumen IM](https://github.com/gzydong/go-chat)使用[GoFrame](https://github.com/gogf/gf)框架开发
## 功能介绍
- 支持 OpenAI 全模型
## 项目预览
- 地址: [https://iim.ai](https://iim.ai)
- 账号: user1@iim.ai 或 user2@iim.ai
- 密码: 123456
## Docker部署
### [传送门](https://github.com/iimeta/iim-api/tree/docker)
## API接口
### 同OpenAI接口
```bash
curl --location 'https://api.iim.ai/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer sk-IIMGD1unkIVxDbCi0ErDjnM0YwVuDUbJOs0XMkTtMJxAEg0N' \
--data '{
"model": "gpt-3.5-turbo-16k",
"stream": true,
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "hi"}
]
}'
```
### 获取使用额度接口
```bash
curl --location 'https://api.iim.ai/v1/token/usage' \
--header 'Authorization: Bearer sk-IIMGD1unkIVxDbCi0ErDjnM0YwVuDUbJOs0XMkTtMJxAEg0N'
```
响应结果
```json
{
"code": 200,
"message": "success",
"data": {
"usage_count": 1,
"used_tokens": 11,
"total_tokens": 10000
}
}
```
## 开源地址
| 仓库 | 前端 | 后端 | API |
| ---- | --------------------------------- | ------------------------------------ | --------------------------------- |
| 主库 | https://github.com/iimeta/iim-web | https://github.com/iimeta/iim-client | https://github.com/iimeta/iim-api |
| 码云 | https://gitee.com/iimeta/iim-web | https://gitee.com/iimeta/iim-client | https://gitee.com/iimeta/iim-api |
## 作者
## 交流群
