-
Notifications
You must be signed in to change notification settings - Fork 43
Add basic fetch example extracted from wrapper repo #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a basic fetch API example demonstrating how to make direct HTTP requests to OpenRouter's API using native fetch without additional libraries. This provides a simpler, more accessible starting point for developers compared to the existing prompt-caching examples.
Key Changes:
- Adds a standalone fetch example with OpenAI-compatible chat completions
- Includes comprehensive inline documentation and error handling
- Uses TypeScript for type safety with local type definitions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bf84ccc to
afadffc
Compare
| console.log('Message:', requestBody.messages[0]?.content); | ||
| console.log(); | ||
|
|
||
| try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
top-level fetch?
afadffc to
e45f7e7
Compare
Merge activity
|
e45f7e7 to
b2d70a2
Compare

Add basic fetch example extracted from wrapper repo
Run biome format