Skip to content

937bb/modelport-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

ModelPort Examples

OpenAI-compatible examples for connecting applications to ModelPort Global.

ModelPort Global provides a unified AI API gateway for routing requests across multiple model providers through familiar API patterns. This repository collects practical examples for developers who want to connect tools, scripts, and AI applications quickly.

Website: https://www.modelportglobal.com/

Supported Model Families

ModelPort Global is designed for API aggregation across domestic Chinese models and global models, including examples such as DeepSeek, Qwen, GLM, Claude, and GPT.

Use the exact model name available in your ModelPort account when running these examples.

What You Can Build

  • Chat completions with an OpenAI-compatible endpoint
  • Streaming responses for chat UIs and agents
  • Tooling integrations for developer tools, internal apps, and custom AI workflows
  • Usage tracking, model routing, and cost-aware development workflows

Quick Start

Set your endpoint and API key:

export MODELPORT_BASE_URL="https://www.modelportglobal.com/v1"
export MODELPORT_API_KEY="your_authorized_api_key"
export MODELPORT_MODEL="your-model-name"

Run a simple request:

curl "$MODELPORT_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $MODELPORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model-name",
    "messages": [
      { "role": "user", "content": "Write a one-line product tagline for an AI gateway." }
    ]
  }'

Examples

Folder Description
examples/curl Minimal command-line requests
examples/node Node.js SDK-style usage
examples/python Python SDK-style usage

Compatible Use Cases

  • OpenAI-compatible SDK clients
  • AI chat desktop clients
  • Agent frameworks
  • Internal model routing services
  • Usage dashboards and cost monitoring

Environment Variables

Name Required Description
MODELPORT_BASE_URL Yes API base URL for ModelPort-compatible requests
MODELPORT_API_KEY Yes Your authorized API key
MODELPORT_MODEL No Default model name used by examples

Notes

Use this repository only with API keys and upstream services that you are authorized to access. Model availability, pricing, and routing behavior may vary by account and configuration.

Links

About

OpenAI-compatible examples for DeepSeek, Qwen, GLM, Claude, GPT, and ModelPort Global

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors