Skip to content

No output in Opencode with OpenAI-compatible Straico provider (tokens used, cURL works, UI empty) #2724

Closed

Description

@niteshmanav

When using the Straico OpenAI-compatible API as a provider in Opencode (v0.11.1), prompts are received and tokens are billed on the Straico backend, but no assistant response is ever surfaced in the Opencode UI. There is no error, no output, and no “message” content displayed. This occurs with all tested Straico chat models, including x-ai/grok-4, openai/o3-mini, anthropic/claude-sonnet-4, etc.

  • cURL produces correct, complete responses.
  • Session, provider, and model are detected and initialized in logs.
  • Opencode logs show request sent, model found, “getSDK” completed, “start-step”/“finish-step” published—but no content displayed.

To Reproduce

  1. Set up opencode.json with confirmed model ID(s) from Straico /v0/models endpoint.
  2. Authenticate opencode auth login (straico chosen).
  3. Start Opencode with opencode --print-logs
  4. Send a prompt via UI/chat.
  5. Dialogue never appears, session completes, no errors visible.

Expected behavior
Assistant reply (message.content) from Straico API should be shown in UI.

Screenshots / Logs

  • Straico /v0/models returns correct model IDs.
  • cURL to Straico:
    curl -X POST "https://api.straico.com/v0/chat/completions" \
    -H "Authorization: Bearer <MY_API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{"model": "x-ai/grok-4", "messages": [{"role":"user", "content":"Test message"}]}'

Gives response like:

{
  "choices": [{
    "message": { "role": "assistant", "content": "Hello! This is Grok, built by xAI, responding..." }
  }],
  ...
}
  • Opencode logs (snippet):
    service=provider providerID=straico modelID=x-ai/grok-4 found
    ... type=start-step part
    ... type=finish-step part
    ... type=finish part
    
  • No error, no output, session times out/ends normally.

Additional context

  • Removal of cache (rm -rf ~/.cache/opencode ~/.local/share/opencode) and latest release make no difference.
  • Occurs across all tested Straico OpenAI-compatible models.
  • Model usage and billing confirmed in Straico dashboard.
  • cURL always returns working output (see above).

System details

  • Opencode version: 0.11.1
  • macOS
  • Straico API, OpenAI-compatible REST
  • Models tested: x-ai/grok-4, openai/o3-mini, anthropic/claude-sonnet-4 and more

Activity

  1. rekram1-node commented on Sep 21, 2025

    @rekram1-node
    Collaborator

    can u share your opencode.json?

  2. niteshmanav commented on Sep 21, 2025

    @niteshmanav
    Author

    Sure. I have added this json file under /Users/nites/.config/opencode on my mac.

    {
    "$schema": "https://opencode.ai/config.json",
    "provider": {
    "straico": {
    "npm": "@ai-sdk/openai-compatible",
    "options": {
    "baseURL": "https://api.straico.com/v0"
    },
    "models": {
    "amazon/nova-lite-v1": {},
    "amazon/nova-micro-v1": {},
    "amazon/nova-pro-v1": {},
    "anthropic/claude-3-opus": {},
    "anthropic/claude-3-5-haiku-20241022": {},
    "anthropic/claude-3.5-sonnet": {},
    "anthropic/claude-3.7-sonnet:thinking": {},
    "anthropic/claude-3.7-sonnet": {},
    "anthropic/claude-sonnet-4": {},
    "cohere/command-r-08-2024": {},
    "cohere/command-r-plus-08-2024": {},
    "deepseek/deepseek-chat": {},
    "deepseek/deepseek-r1": {},
    "deepseek/deepseek-r1:nitro": {},
    "deepseek/deepseek-chat-v3-0324": {},
    "deepseek/deepseek-chat-v3.1": {},
    "cognitivecomputations/dolphin-mixtral-8x7b": {},
    "alpindale/goliath-120b": {},
    "google/gemini-2.5-flash": {},
    "google/gemini-2.5-flash-lite": {},
    "google/gemini-2.0-flash-001": {},
    "google/gemini-pro-1.5": {},
    "google/gemini-2.5-pro-preview": {},
    "google/gemma-2-27b-it": {},
    "gryphe/mythomax-l2-13b": {},
    "meta-llama/llama-3-70b-instruct:nitro": {},
    "meta-llama/llama-3.1-405b-instruct": {},
    "meta-llama/llama-3.1-70b-instruct": {},
    "meta-llama/llama-3.3-70b-instruct": {},
    "meta-llama/llama-4-maverick": {},
    "microsoft/phi-4": {},
    "mistralai/codestral-mamba": {},
    "mistralai/mistral-medium-3": {},
    "mistralai/mixtral-8x7b-instruct": {},
    "moonshotai/kimi-k2:free": {},
    "moonshotai/kimi-k2-0905": {},
    "nvidia/llama-3.1-nemotron-70b-instruct": {},
    "nvidia/llama-3.1-nemotron-ultra-253b-v1": {},
    "nvidia/llama-3.3-nemotron-super-49b-v1": {},
    "openai/gpt-4.1": {},
    "openai/gpt-4.1-mini": {},
    "openai/gpt-4.1-nano": {},
    "openai/gpt-4o-2024-08-06": {},
    "openai/gpt-4o-2024-11-20": {},
    "openai/gpt-4o-mini": {},
    "openai/gpt-5": {},
    "openai/gpt-5-chat": {},
    "openai/gpt-5-mini": {},
    "openai/gpt-5-nano": {},
    "openai/o1": {},
    "openai/o1-pro": {},
    "openai/o1-mini": {},
    "o3-2025-04-16": {},
    "o3-deep-research-2025-06-26": {},
    "openai/o3-mini-high": {},
    "openai/o3-mini": {},
    "openai/o4-mini": {},
    "openai/o4-mini-high": {},
    "perplexity/llama-3.1-sonar-small-128k-online": {},
    "perplexity/sonar": {},
    "perplexity/sonar-deep-research": {},
    "perplexity/sonar-reasoning": {},
    "qwen/qwen-2-72b-instruct": {},
    "qwen/qwen-2-vl-72b-instruct": {},
    "qwen/qwen-2.5-72b-instruct": {},
    "qwen/qwen2.5-vl-32b-instruct:free": {},
    "qwen/qwen3-235b-a22b": {},
    "qwen/qwen3-coder": {},
    "microsoft/wizardlm-2-8x22b": {},
    "z-ai/glm-4.5v": {},
    "x-ai/grok-2-1212": {},
    "x-ai/grok-3-beta": {},
    "x-ai/grok-3-mini-beta": {},
    "x-ai/grok-4": {}
    }
    }
    }
    }

  3. rekram1-node commented on Sep 21, 2025

    @rekram1-node
    Collaborator

    Hmm I think i will need to create a straico account to test this I tried using some other providers (setup using same mechanism u are doing) and it worked fine for me

    I will get back to you once I have setup straico or encountered similar issues to u

  4. niteshmanav commented on Sep 22, 2025

    @niteshmanav
    Author

    Thank you for looking into this. If you are on Discord Opencode, please share your username and I will share test API of Straico with you, if that's helpful

  5. rekram1-node commented on Sep 22, 2025

    @rekram1-node
    Collaborator

    aidenc9727

  6. niteshmanav commented on Sep 22, 2025

    @niteshmanav
    Author

    Just shared via Discord

  7. rekram1-node commented on Sep 23, 2025

    @rekram1-node
    Collaborator

    I tested the following for straico:

    import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
    import { streamText } from "ai";
    
    const straico = createOpenAICompatible({
      name: "straico",
      baseURL: "https://api.straico.com/v0",
      apiKey: "****",
    });
    
    const model = straico("openai/gpt-4.1-nano");
    
    const result = streamText({
      model,
      prompt: "hello",
    });
    
    for await (const textPart of result.textStream) {
      console.log(textPart);
    }
    

    This returns nothing so streaming may not be properly implemented on their end?

    They don't seem to properly follow openai spec so this isn't an opencode issue seems like a bug on their end

  8. nicolas23589 commented on Oct 18, 2025

    @nicolas23589

    Hi, it’s Nicolás from Straico Support. I just wanted to share that we recently added Chat Completion and Model Information endpoints to our API v2, which are fully OpenAI-compatible. Streaming isn’t supported yet, but asynchronous completions work normally with OpenAI libraries, so previous code should work by replacing the streaming function with the chat completion function.

    For anyone interested, check out our documentation here: https://documenter.getpostman.com/view/5900072/2s9YyzddrR#f16ebe47-10a4-41eb-b2e2-97831e7ee6de

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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