[bug] Compatible OpenAI providers cannot price correctly #212

Closed
opened 2026-02-16 17:25:47 -05:00 by yindo · 0 comments
Owner

Originally created by @douglarek on GitHub (Jun 21, 2025).

Originally assigned to: @thdxr on GitHub.

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.

Originally created by @douglarek on GitHub (Jun 21, 2025). Originally assigned to: @thdxr on GitHub. For example, I configured the following GitHub Copilot OpenAI compatibility: ```json { "$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](https://github.com/user-attachments/assets/174c28f8-c49d-47ff-a5fe-12966e86b328) **Note: I'm using the latest version 0.1.117, and I recall version 0.1.109 was working fine.**
yindo closed this issue 2026-02-16 17:25:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#212