|
| 1 | +# ernie-4.5-300b-a47b-paddle |
| 2 | + |
| 3 | +{% columns %} |
| 4 | +{% column width="66.66666666666666%" %} |
| 5 | +{% hint style="info" %} |
| 6 | +This documentation is valid for the following list of our models: |
| 7 | + |
| 8 | +* `baidu/ernie-4.5-300b-a47b-paddle` |
| 9 | +{% endhint %} |
| 10 | +{% endcolumn %} |
| 11 | + |
| 12 | +{% column width="33.33333333333334%" %} |
| 13 | +<a href="https://aimlapi.com/app/baidu/ernie-4-5-300b-a47b-paddle" class="button primary">Try in Playground</a> |
| 14 | +{% endcolumn %} |
| 15 | +{% endcolumns %} |
| 16 | + |
| 17 | +## Model Overview |
| 18 | + |
| 19 | +A super-large language model, positioned as of August 2025 as a leading Chinese MoE architecture and a foundation model for enterprise applications. |
| 20 | + |
| 21 | +{% hint style="success" %} |
| 22 | +[Create AI/ML API Key](https://aimlapi.com/app/keys) |
| 23 | +{% endhint %} |
| 24 | + |
| 25 | +<details> |
| 26 | + |
| 27 | +<summary>How to make the first API call</summary> |
| 28 | + |
| 29 | +**1️⃣ Required setup (don’t skip this)**\ |
| 30 | +▪ **Create an account:** Sign up on the AI/ML API website (if you don’t have one yet).\ |
| 31 | +▪ **Generate an API key:** In your account dashboard, create an API key and make sure it’s **enabled** in the UI. |
| 32 | + |
| 33 | +**2️ Copy the code example**\ |
| 34 | +At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project. |
| 35 | + |
| 36 | +**3️ Update the snippet for your use case**\ |
| 37 | +▪ **Insert your API key:** replace `<YOUR_AIMLAPI_KEY>` with your real AI/ML API key.\ |
| 38 | +▪ **Select a model:** set the `model` field to the model you want to call.\ |
| 39 | +▪ **Provide input:** fill in the request input field(s) shown in the example (for example, `messages` for chat/LLM models, or other inputs for image/video/audio models). |
| 40 | + |
| 41 | +**4️ (Optional) Tune the request**\ |
| 42 | +Depending on the model type, you can add optional parameters to control the output (e.g., generation settings, quality, length, etc.). See the API schema below for the full list. |
| 43 | + |
| 44 | +**5️ Run your code**\ |
| 45 | +Run the updated code in your development environment. Response time depends on the model and request size, but simple requests typically return quickly. |
| 46 | + |
| 47 | +{% hint style="success" %} |
| 48 | +If you need a more detailed walkthrough for setting up your development environment and making a request step by step — feel free to use our [Quickstart guide](../../../quickstart/setting-up.md). |
| 49 | +{% endhint %} |
| 50 | + |
| 51 | +</details> |
| 52 | + |
| 53 | +## API Schema |
| 54 | + |
| 55 | +{% openapi-operation spec="ernie-4-5-300b-a47b-paddle" path="/v1/chat/completions" method="post" %} |
| 56 | +[OpenAPI ernie-4-5-300b-a47b-paddle](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/baidu/ernie-4.5-300b-a47b-paddle.json) |
| 57 | +{% endopenapi-operation %} |
| 58 | + |
| 59 | +## Code Example |
| 60 | + |
| 61 | +{% tabs %} |
| 62 | +{% tab title="Python" %} |
| 63 | +{% code overflow="wrap" %} |
| 64 | +```python |
| 65 | +import requests |
| 66 | +import json # for getting a structured output with indentation |
| 67 | + |
| 68 | +response = requests.post( |
| 69 | + "https://api.aimlapi.com/v1/chat/completions", |
| 70 | + headers={ |
| 71 | + # Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>: |
| 72 | + "Authorization":"Bearer <YOUR_AIMLAPI_KEY>", |
| 73 | + "Content-Type":"application/json" |
| 74 | + }, |
| 75 | + json={ |
| 76 | + "model":"baidu/ernie-4.5-300b-a47b-paddle", |
| 77 | + "messages":[ |
| 78 | + { |
| 79 | + "role":"user", |
| 80 | + "content":"Hi! What do you think about mankind?" # insert your prompt |
| 81 | + } |
| 82 | + ] |
| 83 | + } |
| 84 | +) |
| 85 | + |
| 86 | +data = response.json() |
| 87 | +print(json.dumps(data, indent=2, ensure_ascii=False)) |
| 88 | +``` |
| 89 | +{% endcode %} |
| 90 | +{% endtab %} |
| 91 | + |
| 92 | +{% tab title="JavaScript" %} |
| 93 | +{% code overflow="wrap" %} |
| 94 | +```javascript |
| 95 | +async function main() { |
| 96 | + const response = await fetch('https://api.aimlapi.com/v1/chat/completions', { |
| 97 | + method: 'POST', |
| 98 | + headers: { |
| 99 | + // insert your AIML API Key instead of <YOUR_AIMLAPI_KEY> |
| 100 | + 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>', |
| 101 | + 'Content-Type': 'application/json', |
| 102 | + }, |
| 103 | + body: JSON.stringify({ |
| 104 | + model: 'baidu/ernie-4.5-300b-a47b-paddle', |
| 105 | + messages:[ |
| 106 | + { |
| 107 | + role:'user', |
| 108 | + content: 'Hi! What do you think about mankind?' // insert your prompt here |
| 109 | + } |
| 110 | + ], |
| 111 | + }), |
| 112 | + }); |
| 113 | + |
| 114 | + const data = await response.json(); |
| 115 | + console.log(JSON.stringify(data, null, 2)); |
| 116 | +} |
| 117 | + |
| 118 | +main(); |
| 119 | +``` |
| 120 | +{% endcode %} |
| 121 | +{% endtab %} |
| 122 | +{% endtabs %} |
| 123 | + |
| 124 | +<details> |
| 125 | + |
| 126 | +<summary>Response</summary> |
| 127 | + |
| 128 | +{% code overflow="wrap" %} |
| 129 | +```json5 |
| 130 | +{ |
| 131 | + "id": "9a0e333a0cfa4d86c89a1f7bd3a2919f", |
| 132 | + "object": "chat.completion", |
| 133 | + "created": 1768943231, |
| 134 | + "model": "baidu/ernie-4.5-300b-a47b-paddle", |
| 135 | + "choices": [ |
| 136 | + { |
| 137 | + "index": 0, |
| 138 | + "message": { |
| 139 | + "role": "assistant", |
| 140 | + "content": "The question \"What do you think about mankind?\" invites a reflection on humanity's complexities. Here's a structured response:\n\n**Step 1: Define the scope** \nMankind encompasses both collective achievements and individual flaws. It's a species marked by creativity, empathy, and resilience, yet also by conflict, inequality, and environmental impact.\n\n**Step 2: Highlight positive traits** \nHumanity has demonstrated remarkable capacity for innovation (e.g., technology, medicine), cultural expression (art, literature), and moral progress (civil rights, environmental awareness). Cooperation during crises, such as disaster relief or global health initiatives, underscores collective potential.\n\n**Step 3: Acknowledge challenges** \nPersistent issues like war, poverty, and systemic injustice reveal ethical gaps. Environmental degradation and climate change further highlight unsustainable practices. These contradictions often stem from short-term thinking or unequal resource distribution.\n\n**Step 4: Emphasize growth potential** \nHistory shows humanity's ability to learn and adapt. Movements for social justice, renewable energy transitions, and scientific breakthroughs suggest progress is possible when values align with action.\n\n**Final Answer** \nMankind is a paradoxical yet hopeful entity—capable of profound compassion and destructive shortsightedness. Its future hinges on balancing self-interest with collective responsibility, leveraging intelligence and empathy to address shared challenges." |
| 141 | + }, |
| 142 | + "finish_reason": "stop" |
| 143 | + } |
| 144 | + ], |
| 145 | + "usage": { |
| 146 | + "prompt_tokens": 13, |
| 147 | + "completion_tokens": 289, |
| 148 | + "total_tokens": 302, |
| 149 | + "prompt_tokens_details": null, |
| 150 | + "completion_tokens_details": null |
| 151 | + }, |
| 152 | + "system_fingerprint": "", |
| 153 | + "meta": { |
| 154 | + "usage": { |
| 155 | + "credits_used": 615 |
| 156 | + } |
| 157 | + } |
| 158 | +} |
| 159 | +``` |
| 160 | +{% endcode %} |
| 161 | + |
| 162 | +</details> |
0 commit comments