How to set the token size and price supported by a custom model #6809

Closed
opened 2026-02-16 18:05:20 -05:00 by yindo · 2 comments
Owner

Originally created by @no-teasy on GitHub (Jan 19, 2026).

Originally assigned to: @jayair on GitHub.

Question

How to set the token size and price supported by a custom model

Originally created by @no-teasy on GitHub (Jan 19, 2026). Originally assigned to: @jayair on GitHub. ### Question How to set the token size and price supported by a custom model
yindo added the docs label 2026-02-16 18:05:20 -05:00
yindo closed this issue 2026-02-16 18:05:20 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6320: [FEATURE]: Show pricing (not sure what unit) per model in the model selection modal
  • #9311: [FEATURE]: Use models.dev data for custom providers - Request to use models.dev for custom model metadata including pricing and context limits

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of existing issues. Please check: - #6320: [FEATURE]: Show pricing (not sure what unit) per model in the model selection modal - #9311: [FEATURE]: Use models.dev data for custom providers - Request to use models.dev for custom model metadata including pricing and context limits Feel free to ignore if none of these address your specific case.
Author
Owner

@R44VC0RP commented on GitHub (Jan 19, 2026):

If I understand correctly, this is configurable via your opencode.json config with these parameters:

{
  provider: {
    customprovider: {
      name: My Custom Provider,
      npm: @ai-sdk/openai-compatible,
      options: {
        apiKey: {env:API_KEY},
        baseURL: https://api.example.com
      },
      models: {
        my-model-name: {
          limit: { context: 1000000, output: 32000 },
          cost: { input: 0.3, output: 1.2 },
          temperature: true,
          reasoning: true,
          tool_call: true
        }
      }
    }
  }
}
@R44VC0RP commented on GitHub (Jan 19, 2026): If I understand correctly, this is configurable via your `opencode.json` config with these parameters: ```json { provider: { customprovider: { name: My Custom Provider, npm: @ai-sdk/openai-compatible, options: { apiKey: {env:API_KEY}, baseURL: https://api.example.com }, models: { my-model-name: { limit: { context: 1000000, output: 32000 }, cost: { input: 0.3, output: 1.2 }, temperature: true, reasoning: true, tool_call: true } } } } } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6809