<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nagiport</title>
    <description>The latest articles on DEV Community by Nagiport (@kyonhuo).</description>
    <link>https://dev.to/kyonhuo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4286550%2Fa8af60bf-9e8d-431c-bf04-dc3e8c52a9cd.png</url>
      <title>DEV Community: Nagiport</title>
      <link>https://dev.to/kyonhuo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kyonhuo"/>
    <language>en</language>
    <item>
      <title>Setting Up the OpenAI-Compatible Nagiport API in OpenCode</title>
      <dc:creator>Nagiport</dc:creator>
      <pubDate>Sun, 06 Dec 2026 15:27:19 +0000</pubDate>
      <link>https://dev.to/kyonhuo/setting-up-the-openai-compatible-nagiport-api-in-opencode-23p2</link>
      <guid>https://dev.to/kyonhuo/setting-up-the-openai-compatible-nagiport-api-in-opencode-23p2</guid>
      <description>&lt;p&gt;Nagiport API is an OpenAI-compatible API that lets you use multiple models through a single API key and a single endpoint. This guide shows how to set it up in OpenCode, from registration and issuing an API key to the &lt;code&gt;opencode.json&lt;/code&gt; configuration, model limits, and pricing.&lt;/p&gt;

&lt;p&gt;All prices and plan details below are from the official pricing page: &lt;a href="https://nagiport.com/ja/pricing/" rel="noopener noreferrer"&gt;https://nagiport.com/ja/pricing/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Register and issue an API key
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open the Nagiport console at &lt;a href="https://app.nagiport.com/auth/sign-in" rel="noopener noreferrer"&gt;https://app.nagiport.com/auth/sign-in&lt;/a&gt; and sign up with your email address.&lt;/li&gt;
&lt;li&gt;Verify your email address using the verification email.&lt;/li&gt;
&lt;li&gt;Choose a plan and complete payment (see the pricing section below). You apply for a plan directly from the plan card on the pricing page — click "このプランで申し込む" on the plan you want.&lt;/li&gt;
&lt;li&gt;In the console, issue an API key. Copy it right away: the key is shown only once. Treat it like a password and never share it or commit it to a repository.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are no extra charges beyond your plan's allowance. If you use up your allowance, usage stops; the service does not bill you for overuse.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Configure OpenCode with opencode.json
&lt;/h2&gt;

&lt;p&gt;Create or edit &lt;code&gt;opencode.json&lt;/code&gt; in your project (or in your OpenCode config directory) and add Nagiport as an OpenAI-compatible provider. Set the API key as an environment variable, for example &lt;code&gt;NAGIPORT_API_KEY&lt;/code&gt;, and set &lt;code&gt;baseURL&lt;/code&gt; to the OpenAI-compatible endpoint shown in the Nagiport console after you issue your key. Use the exact model ID shown in the console for the model you want.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://opencode.ai/config.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"provider"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"nagiport"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"npm"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"@ai-sdk/openai-compatible"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Nagiport API"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"options"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"baseURL"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;the OpenAI-compatible endpoint shown in the Nagiport console&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"apiKey"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"{env:NAGIPORT_API_KEY}"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"models"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;"glm-5.3-flash-abliterated"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"GLM 5.3 Flash Abliterated"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;"limit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nl"&gt;"context"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;262144&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nl"&gt;"output"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;131072&lt;/span&gt;
          &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then start OpenCode and select the Nagiport model. If the model does not appear, check that the API key is set, that &lt;code&gt;baseURL&lt;/code&gt; matches the console, and that the model ID is exactly as shown in the console.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Model limits: GLM example
&lt;/h2&gt;

&lt;p&gt;For GLM 5.3 Flash Abliterated, the limits are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Output limit: 131,072 tokens&lt;/li&gt;
&lt;li&gt;Context limit: 262,144 tokens&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep these limits in mind for long coding sessions: a large context window helps with big codebases, but very long outputs should be split into smaller steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Pricing
&lt;/h2&gt;

&lt;p&gt;Prices below are per 1 million tokens, tax included (JPY), from the official pricing page.&lt;/p&gt;

&lt;h3&gt;
  
  
  Plans
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Plan&lt;/th&gt;
&lt;th&gt;Monthly fee (tax incl.)&lt;/th&gt;
&lt;th&gt;Allowance&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Starter&lt;/td&gt;
&lt;td&gt;¥3,000 (approx. $18.75)&lt;/td&gt;
&lt;td&gt;¥3,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Standard&lt;/td&gt;
&lt;td&gt;¥6,000 (approx. $37.50)&lt;/td&gt;
&lt;td&gt;¥6,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pro&lt;/td&gt;
&lt;td&gt;¥9,000 (approx. $56.25)&lt;/td&gt;
&lt;td&gt;¥9,000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All plans include all 4 models, the same per-token rates, a cache discount, and the OpenAI-compatible API. The plan fee is used as your usage allowance, and there are no extra charges beyond the cap.&lt;/p&gt;

&lt;h3&gt;
  
  
  Per-token rates (per 1M tokens, tax incl.)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Cached input&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DeepSeek V4.1 Flash 1017 Fast&lt;/td&gt;
&lt;td&gt;¥4&lt;/td&gt;
&lt;td&gt;¥0.75&lt;/td&gt;
&lt;td&gt;¥30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kimi K3.1 Pro&lt;/td&gt;
&lt;td&gt;¥140&lt;/td&gt;
&lt;td&gt;¥60&lt;/td&gt;
&lt;td&gt;¥950&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.8 27B Abliterated&lt;/td&gt;
&lt;td&gt;¥200&lt;/td&gt;
&lt;td&gt;¥25&lt;/td&gt;
&lt;td&gt;¥900&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GLM 5.3 Flash Abliterated&lt;/td&gt;
&lt;td&gt;¥50&lt;/td&gt;
&lt;td&gt;¥10&lt;/td&gt;
&lt;td&gt;¥200&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Input starts at ¥4 per 1 million tokens, so the cheapest model is a good fit for everyday coding assistance in OpenCode, while the other models are available for heavier tasks through the same key.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rollover
&lt;/h3&gt;

&lt;p&gt;If you do not use up your allowance, the unused part rolls over to the next month. Rolled-over allowance is consumed first, and it cannot be rolled over again to the month after next.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Apply from the pricing page
&lt;/h2&gt;

&lt;p&gt;You can apply directly from the pricing page (&lt;a href="https://nagiport.com/ja/pricing/):" rel="noopener noreferrer"&gt;https://nagiport.com/ja/pricing/):&lt;/a&gt; choose a plan card and click "このプランで申し込む". That takes you to the console, where you complete payment and issue your API key.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Sign up in the Nagiport console, verify your email, choose a plan, and issue an API key.&lt;/li&gt;
&lt;li&gt;Add Nagiport as an OpenAI-compatible provider in &lt;code&gt;opencode.json&lt;/code&gt;, using the endpoint and model ID shown in the console.&lt;/li&gt;
&lt;li&gt;Pick a model that fits your task and budget — input starts at ¥4 per 1M tokens, and unused allowance rolls over to the next month.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Happy coding with OpenCode and Nagiport API!&lt;/p&gt;

</description>
      <category>opencode</category>
      <category>ai</category>
      <category>api</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
