Skip to content

Conversation

@subtleGradient
Copy link
Contributor

Add basic fetch example extracted from wrapper repo

Run biome format

Copy link
Contributor Author

subtleGradient commented Nov 11, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

Copilot AI left a 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.

@subtleGradient subtleGradient changed the base branch from 02-prompt-caching-fetch to graphite-base/47 November 12, 2025 22:22
@subtleGradient subtleGradient changed the base branch from graphite-base/47 to pdf-example-effect November 12, 2025 23:18
console.log('Message:', requestBody.messages[0]?.content);
console.log();

try {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top-level fetch?

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.

3 participants