Your First SilvaMux API Call

This guide starts from your current workspace and project, helps you create an API key, confirm a model call name, and send your first OpenAI Chat Completions compatible request.

SilvaMux supports the OpenAI Chat Completions compatible format. If you already have OpenAI SDK code, you only need to change the base URL and API key.

Create a Project

Projects isolate different businesses, environments, and API usage. Prepare at least one project before creating an API key.

  1. Sign in to the console and open Projects in the sidebar.
  2. Click New Project.
  3. Fill in the project name; including the business and environment is recommended, for example "personal-assistant-staging".
  4. Click Create.
  5. Confirm the name, project ID, and creation time in the project list.

New project

ScenarioRecommendation
Staging and productionCreate separate projects
Multiple independent appsOne project per app
Temporary experimentsUse a dedicated test project and revoke its keys when done

Get an API Key

API keys are used for model calls; AK/SK credentials are used by compatible APIs that require Access Key ID and Secret Key signing. The two must not be mixed.

Creating an API Key

  1. Make sure your current workspace has at least one project.
  2. Open the API Keys page and click Generate API Key.
  3. Fill in the name, then choose the bound project and API version.
  4. Copy the full sk_live_ key immediately after creation. The full value is shown only once.

Create API Key

API Key created

Store the key as an environment variable:

export SILVAMUX_API_KEY="sk_live_YOUR_API_KEY"

Security Rules

  • Never put keys in browser code, logs, screenshots, or public repositories.
  • Use different keys for testing and production.
  • If a key leaks, revoke the old key first, then update your service configuration.
  • A full key cannot be recovered after it is hidden — create a new one if needed.

First Request

About the model field: use the call name shown on the Model Plaza detail page, preferring the stable alias. Do not assemble it from display names yourself.

Call Examples

curl https://www.silvamux.com/api/v1/chat/completions \
  -H "Authorization: Bearer $SILVAMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m2.5",
    "messages": [
      {"role": "user", "content": "Introduce yourself in one sentence"}
    ]
  }'

Streaming

Set stream: true to get a streaming response (SSE):

curl https://www.silvamux.com/api/v1/chat/completions \
  -H "Authorization: Bearer $SILVAMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m2.5",
    "messages": [{"role": "user", "content": "Write a short poem"}],
    "stream": true
  }'

The streaming response is Server-Sent Events: each event's data field carries one JSON chunk. You may eventually receive a usage chunk with an empty choices, after which the server closes the connection. Treat the stream end as completion — do not rely solely on data: [DONE].

Using the Anthropic Format

If you are more familiar with the Anthropic Messages API, SilvaMux supports it as well:

curl https://www.silvamux.com/api/v1/messages \
  -H "Authorization: Bearer $SILVAMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m2.5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

See Text Generation Models for more API formats.