Skip to content

v0.0.1

Compare
Choose a tag to compare
@dingo-actual dingo-actual released this 28 May 23:39
· 15 commits to main since this release
c8bde0e

OpenRouter Python Client (Unofficial) v0.0.1 πŸŽ‰

The first official release of the unofficial Python client for OpenRouter! This comprehensive library provides a fully-typed, feature-rich interface for interacting with large
language models through the OpenRouter API.

πŸš€ Key Features

  • Complete API Coverage: Support for all major OpenRouter endpoints including chat completions, text completions, model information, generations, credits, and API key management
  • Streaming Support: Real-time streaming for chat and completion responses
  • Automatic Rate Limiting: SmartSurge integration automatically configures rate limits based on your API key's limits
  • Type Safety: Fully typed interfaces with Pydantic models for all request and response data
  • Tool Calling: Built-in support for function calling with decorators and helper functions
  • Secure Key Management: In-memory encryption and extensible secrets management
  • Smart Retries: Built-in retry logic with exponential backoff for reliable API communication

πŸ“¦ Installation

  pip install openrouter-client-unofficial

🏁 Quick Start

  from openrouter_client import OpenRouterClient

  client = OpenRouterClient(api_key="your-api-key")

  response = client.chat.create(
      model="anthropic/claude-3-opus",
      messages=[
          {"role": "user", "content": "Hello, world!"}
      ]
  )

  print(response.choices[0].message.content)

πŸ“š Documentation

Check out the comprehensive documentation in the repository, including:

  • Getting started guide
  • API reference
  • Advanced features
  • Example implementations
  • Configuration options

πŸ§ͺ Testing

This release includes extensive testing coverage with both local unit tests and remote integration tests, ensuring reliability and stability.

⚠️ Important Notes

  • This is an unofficial client, not affiliated with OpenRouter, Inc.
  • Currently in Alpha stage - expect some breaking changes in future releases
  • Requires Python 3.9 or higher
  • Your usage is subject to OpenRouter's Terms of Service

Full Changelog: Initial release