Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: alexrudall/ruby-openai
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: sinaptia/ruby-openai
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 2 commits
  • 7 files changed
  • 1 contributor

Commits on Jan 15, 2025

  1. Add pricing calculation for OpenAI API responses (chat, embeddings an…

    …d completions)
    
    - Add new OpenAI::Pricing class to calculate costs based on token usage
    - Integrate automatic cost calculation into API response handling
    - Include detailed cost breakdown for:
      - Input tokens (regular, cached, audio)
      - Output tokens (regular, reasoning, audio, predictions)
    
    The pricing data supports all current OpenAI models including GPT-4, embeddings,
    and audio-enabled variants.
    Costs are automatically merged into API responses under a new 'cost' key that
    follows the structure of the "usage" key
    
    Bonus:
    - a script to fetch latest model costs from OpenAI website
    F-3r committed Jan 15, 2025
    Configuration menu
    Copy the full SHA
    5ecbf4e View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2025

  1. use a json cost file

    F-3r committed Jan 17, 2025
    Configuration menu
    Copy the full SHA
    ab219e3 View commit details
    Browse the repository at this point in the history
Loading