> ## Documentation Index
> Fetch the complete documentation index at: https://agent.minimax.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Models / BYOK

> Add a custom model provider with base URL, API key, API format, and model names.

<div className="code-docs">
  BYOK stands for "bring your own key." It lets you connect a model provider using your own API key, choose a preset provider or manually configure a compatible service, and then select those models from the MiniMax Code model menu.

  <img src="https://mintcdn.com/agent-en/Oyv_kdAZLmHKIw9C/images/code/byok-custom-model.png?fit=max&auto=format&n=Oyv_kdAZLmHKIw9C&q=85&s=4620171338aac122bee82b3e33827b14" alt="Custom Model create or edit modal" className="code-screenshot" width="1166" height="1446" data-path="images/code/byok-custom-model.png" />

  ## Add a Provider

  <Steps>
    <Step title="Open custom models">
      Go to **Settings → Usage & model**, then select Add model under Custom model.
    </Step>

    <Step title="Choose a preset or other provider">
      Search for a preset provider, select it, and enter your API key. The preset supplies the base URL, API format, and model configuration. If your provider is not listed, select Others and enter the provider name, base URL, API key, and API format.
    </Step>

    <Step title="Add models">
      Enter a model ID, or select Fetch to choose models from the provider's list. The model ID must match the ID in the provider's documentation.
    </Step>

    <Step title="Save and switch">
      Select Save. Return to the message box and choose the newly added model from the model menu. For models that support thinking settings, you can also adjust them in the parameters menu.
    </Step>
  </Steps>

  The base URL is the address MiniMax Code sends requests to. The API format determines how those requests and responses are structured. Use the values listed in your provider's setup guide.

  ## Save and Test Connections

  | Action | What it does |
  | - | - |
  | Fetch | Retrieves the provider's model list so you can choose which models to add. It does not save your configuration. |
  | Connectivity test | Uses the test button next to a model to check whether it responds with the settings you entered. |
  | Save | Saves your provider and model configuration. It does not automatically test the connection or switch the model used by the current task. |

  ## Recommendation

  Run a connection test before using a model for your work. A successful test confirms that the test request went through. Support for images, video, and other input types should still be checked with examples from your intended use case.

  <Warning>
    Custom model availability, context length, multimodal support, and cost depend on the provider you configure.
  </Warning>

  To have an agent edit the configuration file and verify a real model response, follow [Configure BYOK Models with an Agent](/docs/code/account/byok-agent-setup).
</div>
