Compare commits

..

1 Commits

Author SHA1 Message Date
Dax Raad b259019372 fix(console): proxy inference without parsing 2026-08-22 19:23:06 -04:00
3 changed files with 21 additions and 2 deletions
@@ -86,6 +86,25 @@ export async function handler(
type ProviderInfo = Awaited<ReturnType<typeof selectProvider>>
type CostInfo = ReturnType<typeof calculateCost>
const proxyUrl = new URL(input.request.url)
if (proxyUrl.pathname.startsWith("/zen/")) {
const protocol = opts.format === "anthropic" ? "anthropic" : opts.format === "google" ? "google" : "openai"
proxyUrl.pathname = proxyUrl.pathname.replace(
/^\/zen(?:\/go)?\/v1/,
`/inference/${opts.modelList === "lite" ? "go/" : ""}${protocol}/${protocol === "google" ? "v1beta" : "v1"}`,
)
const request = new Request(proxyUrl, input.request)
const ip = request.headers.get("x-real-ip")
if (ip) request.headers.set("x-zen-ip", ip)
const requestID = request.headers.get("x-opencode-request")
if (requestID) request.headers.set("x-opencode-request-id", requestID)
if (request.headers.get("authorization")?.toLowerCase() === "bearer public")
request.headers.delete("authorization")
if (request.headers.get("x-api-key") === "public") request.headers.delete("x-api-key")
if (request.headers.get("x-goog-api-key") === "public") request.headers.delete("x-goog-api-key")
return fetch(request)
}
const MAX_FAILOVER_RETRIES = 3
const MAX_RETRYABLE_STATUS_RETRIES = 3
const dict = i18n(localeFromRequest(input.request))
+1 -1
View File
@@ -178,7 +178,7 @@ The estimates are also based on the following prices per 1M tokens and the month
| Hy3 | $0.14 | $0.58 | $0.035 | - | $60 |
| Ox Alpha Free | - | - | - | - | - |
**DeepSeek V4 Flash / V4 Flash Vision Exp / V4 Pro:** On weekdays (Monday-Friday, Beijing Time), peak hours are 01:00-04:00 and 06:00-10:00 UTC. Weekends (Saturday and Sunday, Beijing Time) are Off-Peak all day. [Learn more](https://api-docs.deepseek.com/quick_start/pricing/).
**DeepSeek V4 Flash / V4 Flash Vision Exp / V4 Pro:** Peak hours are 01:00-04:00 and 06:00-10:00 UTC; all other hours are Off-Peak. [Learn more](https://api-docs.deepseek.com/quick_start/pricing/).
**DeepSeek V4 Flash Vision Exp:** Images are converted into tokens based on their dimensions and billed as input tokens alongside text tokens. [Learn more](https://api-docs.deepseek.com/quick_start/pricing/).
+1 -1
View File
@@ -223,7 +223,7 @@ We support a pay-as-you-go model. Below are the prices **per 1M tokens**.
**GPT 5.6 Sol:** Prices shown include a 50% discount through September 18, 2026.
**DeepSeek V4 Flash / Pro:** On weekdays (Monday-Friday, Beijing Time), peak hours are 01:00-04:00 and 06:00-10:00 UTC. Weekends (Saturday and Sunday, Beijing Time) are Off-Peak all day. [Learn more](https://api-docs.deepseek.com/quick_start/pricing/).
**DeepSeek V4 Flash / Pro:** Peak hours are 01:00-04:00 and 06:00-10:00 UTC; all other hours are Off-Peak. [Learn more](https://api-docs.deepseek.com/quick_start/pricing/).
You may notice [low-cost models](/docs/config/#models), such as Haiku, Nano, or Flash, in your usage history. OpenCode uses these models to generate session titles.