one-api.service 338 B

12345678910111213
  1. [Unit]
  2. Description=One API Service
  3. After=network.target
  4. [Service]
  5. User=yourusername # 守护进程用户名
  6. WorkingDirectory=/path/to/One-API # One API运行路径
  7. ExecStart=/path/to/One-API/one-api --port 3000 --log-dir /path/to/One-API/logs # 端口
  8. Restart=always
  9. RestartSec=5
  10. [Install]
  11. WantedBy=multi-user.target