Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(usage): add OpenCode provider priced from models.dev #6014

ClosedSkyVence(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/6014/headopened View on GitHub

Showing 14 changed files with 133 additions and 2 deletions (loading 12).

x
0 of 14 viewed, 14 left
5 additions and 2 deletionsapps/mobile/src/features/usage/usageProviders.tsModified
View file
@@ -5,21 +5,24 @@
* Series and table order. The chart stacks providers from the bottom in this
* order, so it also fixes which band sits on top of the bars.
*/
-export const PROVIDER_ORDER: readonly UsageProviderKind[] = ["codex", "claude"];
+export const PROVIDER_ORDER: readonly UsageProviderKind[] = ["codex", "claude", "opencode"];
​
export const PROVIDER_LABEL: Record<UsageProviderKind, string> = {
claude: "Claude Code",
codex: "Codex",
+ opencode: "OpenCode",
};
​
/**
* Claude's brand orange holds in both themes; Codex is neutral and must flip
- * with the theme or its bars vanish against the matching background.
+ * with the theme or its bars vanish against the matching background. OpenCode's
+ * violet reads on both.
*/
export function useProviderColors(): Record<UsageProviderKind, string> {
const scheme = useColorScheme();
return {
claude: "#d97757",
codex: scheme === "dark" ? "#e6e6e6" : "#3c3c43",
+ opencode: "#a78bfa",
};
128 additions and 0 deletionsapps/server/src/usage/UsageService.test.tsAdded
View file
@@ -0,0 +1,128 @@