Skip to content

feat(models): add API Route OpenAI-compatible wrapper - #1162

Open
DennyHo0917 wants to merge 1 commit into
ScrapeGraphAI:pre/betafrom
DennyHo0917:feat/api-route-model
Open

DennyHo0917 wants to merge 1 commit into
ScrapeGraphAI:pre/betafrom
DennyHo0917:feat/api-route-model

Conversation

@DennyHo0917

Copy link
Copy Markdown

Summary

Add APIRoute, a small ChatOpenAI wrapper that maps api_key to the OpenAI-compatible client and fixes the base URL to https://global.api-route.com/v1. Export it from scrapegraphai.models.

This follows the existing Atlas Cloud and Cheaper Inference wrappers. For graph use, pass an APIRoute instance as model_instance and provide model_tokens for the chosen API Route model. I did not add a token catalog entry because context limits vary by model and were not verified here.

Testing

  • pytest tests/test_apiroute_model.py -q — 1 passed with the minimal test dependencies
  • ruff check, black --check, and isort --check-only on the new files — passed
  • git diff --check — passed

No live API request was made; the test verifies local endpoint and credential mapping.

This branch has not been deployed

No deployments
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