Website
  1. Start
  • Start
    • Product Intrduction
    • Quick to use
    • Using Nexhina in AI Coding Tools
  • API integration explanation
    • HTTP Status Codes
    • Getting an API Key
    • Authentication
    • Quick Start
    • Streaming Output Guide
    • Request URL
  • API Endpoints
    • Chat
      • Chat Completion
    • Models
      • List Available Models
    • Responses
      • Responses API
    • Embeddings
      • Text Embedding
    • Images
      • Generate Image
    • Audio
      • Text-to-Speech (TTS)
      • Speech-to-Text (STT)
      • Audio Translation
    • Video
      • Generate Video
    • Moderation
      • Content Moderation
    • Rerank
      • Rerank
  • Platform-related
    • Platform agreement
    • Privacy Policy
    • General Questions
  • Schemas
    • ChatRequest
    • Log
    • ChatMessage
    • ToolCall
    • User
    • FunctionDefinition
    • Channel
    • ToolDefinition
    • Token
    • ChatCompletionRequest
    • Redemption
    • ChatCompletionChoice
    • ChatCompletionResponse
    • ChatCompletionChunk
    • ResponseInputText
    • ResponseRequest
    • ResponseOutputText
    • ResponseOutputMessage
    • ResponseObject
    • EmbeddingRequest
    • EmbeddingData
    • EmbeddingResponse
    • ImageGenerationRequest
    • ImageData
    • ImageUsageInputTokensDetails
    • ImageUsage
    • ImageGenerationResponse
    • SpeechRequest
    • TranscriptionRequest
    • TranslationRequest
    • TranscriptionResponse
    • TranslationResponse
    • VideoGenerationRequest
    • VideoData
    • VideoGenerationResponse
    • ModerationRequest
    • ModerationCategory
    • ModerationResult
    • ModerationResponse
    • RerankRequest
    • RerankResult
    • RerankResponse
  1. Start

Using Nexhina in AI Coding Tools

This document explains how to integrate Nexhina into mainstream AI coding tools such as Cursor, Windsurf, and Continue, so that these tools can use your own models and quotas.

Table of Contents#

1. Using Nexhina in Cursor
1.1 Adding Nexhina Models
1.2 Configuring API Key and Base URL
1.3 Using Models in Cursor
1.4 Configuring @Docs Document Context
1.5 Referencing Documents with @Docs
2. Using Nexhina in Windsurf
3. Using Nexhina in Continue
4. Using Nexhina in VS Code Copilot
5. Using Nexhina in JetBrains AI
6. Using in Chat Tools
7. FAQ

1. Using Nexhina in Cursor#

Cursor is one of the most popular AI coding tools today and supports custom compatible APIs. Nexhina is fully compatible with the standard interface format and is ready to use after configuration.

1.1 Adding Nexhina Models#

1.
Open Cursor and go to Settings → Models
2.
In the Models Names input field at the bottom, enter the model name you want to use and click Add model
Recommended models:
Use CaseModel NameDescription
Daily codinggpt-4oTop-tier multimodal, strong general coding
Complex reasoningo3Enhanced reasoning, good for debugging, math, and logic
General conversationgpt-4o-miniFast and cost-effective, great for everyday chat
Long contextgpt-4.11M context window, handles large codebases
Professional writingclaude-sonnet-4-20250514Claude Sonnet 4, strong at long-form generation and analysis
3.
After adding, toggle on the switch for the corresponding model in the list

1.2 Configuring API Key and Base URL#

In the same Settings → Models page, find the API Key configuration area:
Config ItemValue
API Keysk-your-Nexhina-key (your Nexhina token)
Base URLhttps://token.nexhina.ai/v1
Click Verify after filling in. A success message indicates the configuration is complete.

1.3 Using Models in Cursor#

After configuration:
1.
Open the Cursor Chat panel (shortcut Cmd+L / Ctrl+L)
2.
In the model selection dropdown, select the model you just added
3.
Chat normally — all requests will go through Nexhina

1.4 Configuring @Docs Document Context#

Cursor's @Docs feature can inject external documents as context into the conversation, allowing the model to answer questions based on your API documentation.
Configuration steps:
1.
Open Cursor Settings → Features → Docs
2.
Click Add new doc
3.
Fill in the configuration:
Config ItemValue
NameNexhina Docs
URLhttps://token.cshuacai.cn (your documentation site URL)
Start URL (optional)Documentation home page URL
4.
Click Save

1.5 Referencing Documents with @Docs#

In Cursor Chat:
1.
Type @Docs and select Nexhina Docs
2.
Then enter your question, for example:
@Nexhina Docs How do I use Function Calling?
@Nexhina Docs Help me write a Python function to call the Embedding API
Cursor will automatically fetch documentation content as context, and the model will give accurate answers based on the documentation.

2. Using Nexhina in Windsurf#

Windsurf (formerly Codeium) also supports standard compatible APIs.

Configuration Steps#

1.
Open Windsurf Settings → AI Provider
2.
Select OpenAI Compatible or Custom Provider
3.
Fill in the configuration:
Config ItemValue
API Base URLhttps://token.nexhina.ai/v1
API Keysk-your-Nexhina-key
Modelgpt-4o or other available models
4.
After saving, you can use it in Cascade and Chat

Windsurf Configuration File#

You can also directly edit the configuration file ~/.windsurf/settings.json:
{
  "aiProvider": "openai-compatible",
  "openaiCompatible": {
    "baseUrl": "https://token.nexhina.ai/v1",
    "apiKey": "sk-your-Nexhina-key",
    "models": [
      { "id": "gpt-4o", "name": "GPT-4o" },
      { "id": "o3", "name": "o3" },
      { "id": "gpt-4o-mini", "name": "GPT-4o mini" },
      { "id": "claude-sonnet-4-20250514", "name": "Claude Sonnet 4" }
    ]
  }
}

3. Using Nexhina in Continue#

Continue is an open-source AI coding assistant that supports VS Code and JetBrains.

Configuration Steps#

Edit the Continue configuration file ~/.continue/config.json (or ~/.continue/config.yaml):

JSON Format#

{
  "models": [
    {
      "title": "Nexhina GPT-4o",
      "provider": "openai",
      "model": "gpt-4o",
      "apiBase": "https://token.nexhina.ai/v1",
      "apiKey": "sk-your-Nexhina-key"
    },
    {
      "title": "Nexhina o3",
      "provider": "openai",
      "model": "o3",
      "apiBase": "https://token.nexhina.ai/v1",
      "apiKey": "sk-your-Nexhina-key"
    },
    {
      "title": "Nexhina GPT-4o mini",
      "provider": "openai",
      "model": "gpt-4o-mini",
      "apiBase": "https://token.nexhina.ai/v1",
      "apiKey": "sk-your-Nexhina-key"
    },
    {
      "title": "Nexhina Claude Sonnet 4",
      "provider": "openai",
      "model": "claude-sonnet-4-20250514",
      "apiBase": "https://token.nexhina.ai/v1",
      "apiKey": "sk-your-Nexhina-key"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Nexhina Autocomplete",
    "provider": "openai",
    "model": "gpt-4o-mini",
    "apiBase": "https://token.nexhina.ai/v1",
    "apiKey": "sk-your-Nexhina-key"
  },
  "embeddingsProvider": {
    "provider": "openai",
    "model": "text-embedding-3-large",
    "apiBase": "https://token.nexhina.ai/v1",
    "apiKey": "sk-your-Nexhina-key"
  }
}

YAML Format#

Configuration Notes#

FieldDescription
modelsList of conversation models, appears in Continue's model selection dropdown
tabAutocompleteModelCode completion model, recommended to use a fast model (gpt-4o-mini)
embeddingsProviderEmbedding model for codebase indexing
Restart VS Code / JetBrains after configuration to select Nexhina models in the Continue panel.

4. Using Nexhina in VS Code Copilot#

GitHub Copilot supports third-party APIs through the custom model feature in Copilot Chat.

Configuration Steps#

1.
Install the GitHub Copilot and GitHub Copilot Chat extensions
2.
Open VS Code Settings → search for github.copilot.chat
3.
Configure custom endpoints (requires VS Code 1.90+ and Copilot custom model support)

Configuring via Environment Variables#

Set environment variables in the terminal before starting VS Code:
Note: Copilot's support for custom models is continuously evolving, and the specific configuration method may change between versions. If custom models are not supported, we recommend using Cursor or Continue as alternatives.

5. Using Nexhina in JetBrains AI#

The AI Assistant in JetBrains IDEs (IntelliJ IDEA / PyCharm / WebStorm, etc.) supports custom endpoints.

Configuration Steps#

1.
Open Settings → Tools → AI Assistant → Providers
2.
Select OpenAI Compatible or Custom Provider
3.
Fill in:
Config ItemValue
Server URLhttps://token.nexhina.ai/v1
API Keysk-your-Nexhina-key
Modelgpt-4o or other
4.
Click Test Connection to verify
5.
Save and you can use it in AI Assistant

6. Using in Chat Tools#

If you only want to use Nexhina's models in a chat interface (rather than coding tools), you can do so in the following ways:

Using Third-Party Clients#

Any client that supports custom APIs can be used:
ClientPlatformConfiguration
ChatBoxDesktopSettings → API Base URL + Key
NextChatWebSettings → Endpoint + Key
LobeChatWeb/DesktopSettings → Model Service → Proxy URL + Key
Open WebUIWebSettings → API URL + Key
Cherry StudioDesktopSettings → API URL + Key
Common configuration:
Config ItemValue
API Base URLhttps://token.nexhina.ai/v1
API Keysk-your-Nexhina-key

7. FAQ#

Q: Verify fails in Cursor. What should I do?#

Check the following:
Check ItemCorrect Value
Base URLhttps://token.nexhina.ai/v1 (ends with /v1)
API KeyStarts with sk-, no extra spaces
Model nameMust be an id returned by GET /v1/models, watch out for case sensitivity
Network connectivitycurl https://token.nexhina.ai/v1/models should return normally

Q: Models don't appear in Cursor?#

Make sure the model toggle is on
Quit and reopen Cursor
Check that the model name is spelled correctly (all lowercase, e.g. gpt-4o not GPT-4o)

Q: Code completion is slow?#

Code completion is latency-sensitive, so we recommend:
Use a fast model: gpt-4o-mini
Avoid using reasoning models (o3) for completion
Continue users can configure a fast model separately in tabAutocompleteModel

Q: Model returns model_not_found error in chat?#

The model is not enabled under your Nexhina account. Contact the administrator to enable it, or switch to an available model.

Q: Can multiple tools share the same Key?#

Yes, but be aware:
All tools share the Key's quota, so watch the usage
Concurrent requests share the Key's rate limit
We recommend using different Keys for different tools to make management and monitoring easier

Q: Can I configure other services and Nexhina at the same time?#

Cursor: Does not support configuring two endpoints simultaneously; the later configuration will override. If you need to use both, we recommend splitting them through Continue or another tool.
Continue: Supported. Add configurations with different apiBase in the models array.

Q: @Docs configuration doesn't reference any content?#

Make sure the documentation URL is publicly accessible
Try opening the configured URL in a browser to confirm the page works
If it's an internal documentation site, Cursor may not be able to crawl it

Q: Continue's Embedding index fails?#

Make sure embeddingsProvider is configured correctly:
{
  "provider": "openai",
  "model": "text-embedding-3-large",
  "apiBase": "https://token.nexhina.ai/v1",
  "apiKey": "sk-your-Nexhina-key"
}
If the error persists, check that the Key has permission for the Embedding API.

Configuration Quick Reference#

There are only two core configurations for all tools:
Config ItemValue
Base URLhttps://token.nexhina.ai/v1
API Keysk-your-Nexhina-key
Configuration entries for each tool:
ToolConfiguration EntryDescription
CursorSettings → Models → API KeyFill in Base URL + Key
WindsurfSettings → AI ProviderSelect Compatible
Continue~/.continue/config.jsonEdit config file
JetBrainsSettings → Tools → AI AssistantSelect Custom Provider
ChatBoxSettings → APIFill in URL + Key
LobeChatSettings → Model ServiceFill in Proxy URL + Key
NextChatSettings → EndpointFill in URL + Key
Open WebUISettings → APIFill in API URL + Key
Modified at 2026-06-30 09:30:15
Previous
Quick to use
Next
HTTP Status Codes
Built with