Skip to content

Getting an issue integrating a custom provider: AI_TypeValidationError, failed type validation #1298

@bhaswata08

Description

@bhaswata08
AI_TypeValidationError: Type validation failed: Value: {"id":"usage-1753417795","provider_id":"or","model":"qwen3-
coder","usage":{"prompt_tokens":5186,"completion_tokens":35,"total_tokens":5221,"multiplier_applied":2,"prompt_tokens_details":
{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_to
kens":0,"rejected_prediction_tokens":0},"zj_usage":{"multiplier":2,"prompt_cost":10372,"completion_cost":70,"total_cost":10442,
"credits_remaining":282833.449999981}},"request_id":"zj-v1cc-fbf09f7e-8f1d-4d50-b7ae-a1f268cb2d48"}.
Error message:
[{"code":"invalid_union","errors":[[{"expected":"array","code":"invalid_type","path":["choices"],"message":"Invalid input:
expected array, received undefined"}],[{"expected":"object","code":"invalid_type","path":["error"],"message":"Invalid input:
expected object, received undefined"}]],"path":[],"message":"Invalid input"}]

opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "zukijourney": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "https://api.zukijourney.com/v1"
      },
      "models": {
        "qwen3-coder": {
          "limit": {
            "context": 262000,
            "output": 2048
          }
        }
      }
    }
  }
}

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