Skip to content

feat: add Astraflow provider support#72

Open
ucloudnb666 wants to merge 1 commit into
Amm1rr:masterfrom
ucloudnb666:feat/astraflow-1779362999
Open

feat: add Astraflow provider support#72
ucloudnb666 wants to merge 1 commit into
Amm1rr:masterfrom
ucloudnb666:feat/astraflow-1779362999

Conversation

@ucloudnb666
Copy link
Copy Markdown

Summary

Adds Astraflow as a new OpenAI-compatible AI provider alongside the existing Gemini integration.

Astraflow (by UCloud / 优刻得) is an OpenAI-compatible AI model aggregation platform supporting 200+ models. Because it speaks the OpenAI REST protocol, the integration requires only setting base_url + api_key — no new SDK is needed.

Changes

File What changed
config.conf.example New [Astraflow] config section documenting the two endpoints and their env vars
src/app/config.py Default config values for the [Astraflow] section
src/app/services/astraflow_client.py Thin async client wrapping the Astraflow REST API via httpx
src/app/endpoints/astraflow.py FastAPI router exposing /astraflow/v1/models and /astraflow/v1/chat/completions
src/app/main.py Import + register the new Astraflow router

Configuration

Copy config.conf.example to config.conf and fill in your key:

[Astraflow]
# Global endpoint
api_key = sk-...          # or set ASTRAFLOW_API_KEY env var
# China endpoint (optional)
cn_api_key =              # or set ASTRAFLOW_CN_API_KEY env var
use_cn_endpoint = false

Endpoints

  • GET /astraflow/v1/models — list available models
  • POST /astraflow/v1/chat/completions — OpenAI-compatible chat completions (streaming supported)

Links

Signed-off-by: ucloudnb666 <ucloudnb666@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant