Skip to content

[bug] Compatible OpenAI providers cannot price correctly #295

Closed as not planned

Description

@douglarek

For example, I configured the following GitHub Copilot OpenAI compatibility:

{
    "$schema": "https://opencode.ai/config.json",
    "autoupdate": false,
    "provider": {
        "openrouter": {
            "npm": "@openrouter/ai-sdk-provider",
            "name": "OpenRouter",
            "options": {},
            "models": {
                "anthropic/claude-3.7-sonnet": {}
            }
        },
        "copilot": {
            "npm": "@ai-sdk/openai-compatible",
            "options": {
                "baseURL": "https://api.githubcopilot.com"
            },
            "models": {
                "claude-3.7-sonnet": {
                    "attachment": true,
                    "reasoning": true,
                    "temperature": true,
                    "tool_call": true,
                    "knowledge": "2024-10-31",
                    "input_modalities": [
                        "text",
                        "image"
                    ],
                    "output_modalities": [
                        "text"
                    ],
                    "cost": {
                        "input": 3,
                        "output": 15,
                        "cache_read": 0.3,
                        "cache_write": 0.3
                    },
                    "limit": {
                        "context": 200000,
                        "output": 64000
                    }
                }
            }
        }
    }
}

But it's no longer being priced:

Image

Note: I'm using the latest version 0.1.117, and I recall version 0.1.109 was working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions