You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To invoke models using the Model Service method, follow these steps:
62
+
To call a model hosted on your own instance, follow these steps:
68
63
69
-
1.**Obtain API Key**: Log in to your user console and create a new API Key
70
-
2.**Set Endpoint**: Replace the SDK endpoint with `<region>.d.run`
71
-
3.**Invoke Model**: Use the official model name along with the new API Key for invocation
64
+
1.**Deploy a Model Instance**: Deploy in a specified region, e.g., `sh-02`
65
+
2.**Get an API Key**: Log in to the user console and create a new API key
66
+
3.**Set the Endpoint**: Set your SDK's endpoint to `<region>.d.run`, e.g., `sh-02.d.run`
67
+
4.**Call the Model**: Use the official model name and your API key
72
68
73
-
**Example Code (Python)**:
69
+
**Example Code (Python):**
74
70
75
71
```python
76
72
import openai
77
73
78
74
openai.api_key ="your-api-key"# Replace with your API Key
79
-
openai.api_base ="<region>.d.run"
75
+
openai.api_base ="https://sh-02.d.run"# Replace with your instance's region
80
76
81
77
response = openai.Completion.create(
82
-
model="u-1100a15812cc/qwen2",
78
+
model="u-1100a15812cc/qwen2",# Replace with your model's full name
83
79
prompt="What is your name?"
84
80
)
85
81
86
82
print(response.choices[0].text)
87
83
```
88
84
89
-
## Support and Feedback
85
+
## Frequently Asked Questions
86
+
87
+
### Q1: How should I choose the invocation method?
88
+
89
+
***MaaS by Token**: Best for lightweight or infrequent use cases.
90
+
***Dedicated Instance**: Ideal for high-performance and high-frequency usage.
91
+
92
+
### Q2: How do I view my API Key?
93
+
94
+
Log in to the user console and go to the API Key management page. See [API Key Management](apikey.md) for more details.
95
+
96
+
### Q3: How do I find the model name?
97
+
98
+
* For MaaS by Token, model names follow the format `public/<model_name>`, such as `public/deepseek-r1`, which can be found on the model details page.
99
+
* For dedicated services, model names follow the format `<username>/<model_name>`, such as `u-1100a15812cc/qwen2`, and can be copied directly from your model list.
100
+
101
+
### Q4: How is pricing calculated for dedicated model instances?
102
+
103
+
Pricing is based on region, instance type, and usage time. For details, refer to the instance pricing page in your user console.
104
+
105
+
## Support & Feedback
90
106
91
-
For any questions or feedback, please contact our [Technical Support Team](../contact/index.md).
107
+
For any questions or feedback, please contact our [technical support team](../contact/index.md).
0 commit comments