Lesson 3 · AdvancedTip
💡 Advanced · Cost-Saving · Efficient

Cost-Savingand Efficient
AdvancedUseTip

Master these tips to make every Token count.
Get 3x+ results with the same budget.

▶ Start Learning ← Lesson 2
Tip 1

Choose RightModel Save Half the Cost

Different Tasks Need DifferentModel,Performance and Cost Both OptimizedOptimization

💰 Most Cost-Saving
DeepSeek-V3
Daily Q&A、Writing、Translation,Best Value,Fast Speed
🧠 Strong Reasoning
DeepSeek-R1
Math、Code、Logical Reasoning, does "Deep Thinking"Then Answer
⚡ Most Powerful
Claude 3.5
Complex Creation、Long Document Analysis、High-Quality Writing
🚀 Ultra Fast
DeepSeek-V4-Flash
UltraResponse,Great for Rapid Iteration
🌍 Multilingual
Qwen3.5
AlibabaTongyiTongyi,Excellent Chinese Comprehension,SupportUltra-Long Context
🎯 Coding
GPT-4o
Best for code generation and debugging. Strong tool-calling ability.
Tip 2

EnableStreaming Output,ResponseSmoother

stream=True makes AI Displays Word by Word Like Typing,No Need to Wait for Complete Output

❌ Standard Mode(Wait for FullOutput)
response = client.chat.completions.create(
  model="deepseek-ai/DeepSeek-V3",
  messages=[...],
  stream=False # waits 3-10...
)
print(response.choices[0].message.content)
✅ Streaming Mode(Instant Display)
response = client.chat.completions.create(
  model="deepseek-ai/DeepSeek-V3",
  messages=[...],
  stream=True # Starts Displaying Immediately
)
for chunk in response:
  print(chunk.choices[0].delta.content, end="")
✨ StreamingresultsPreview:
Tip 3

Use Well System Prompt

In Eachconversations Settings「CharacterSetup」,makes AI More Focused、More Accurate

response = client.chat.completions.create(
  model="deepseek-ai/DeepSeek-V3",
  messages=[
    {
      "role": "system",
      "content": "You are a senior Python developer. Solve problems with clean code, no fluff." # ← CharacterSetup
    },
    {"role": "user", "content": "WriteAFileBatch RenameScript"}
  ]
)
📝
WritingScenario
「You Are a Professional Copywriter,Concise and Powerful Language,Avoid Fluff」
🔍
AnalysisScenario
「You Are a Data Analyst,Speak with Tables and Numbers」
Tip 4

Adjust Temperature Parameters

Control AI Output's Creativity,Different Tasks Need DifferentSettings

0.0
temperature=0 Most Deterministic
Code generation、Data Processing、Format Conversion → Consistent Results Every Time,Accurate and Reliable
0.7
temperature=0.7 Balanced(Default Recommendation)
Daily Q&A、Copywriting、Translation → Accurate and Natural,Most Common
1.2
temperature=1.2 Most Creative
Story Writing、Brainstorming、Ad Copy → Surprisingly creative, but may go off track.
Tip 5

Batch Processing SignificantlyCost-Saving

Combine Multiple Small QuestionsCombine into oneRequest,Reduce API CallTimeCount

❌ Inefficient Approach(MultipleRequest)
# 3TimeAPICall,3Basicscost
result1 = ask("Translation:Hello")
result2 = ask("Translation:World")
result3 = ask("Translation:Python")
✅ Efficient Approach(OneRequest)
# 1TimeAPICall,Save67%cost
result = ask(
  "Translate the following words to Chinese,
  return as JSON.:
  Hello, World, Python"
)
💡 Combine tasks into one prompt. Save 2/3 of the cost, and it's even faster.
Key Concepts

How Tokens Billing Work?

🔤
Token ≈ Token = Basic Unit of Text
English: ~4 characters = 1 Token. Chinese: ~1-2 characters = 1 Token. = 1 Token
📊
Input + OutputBoth Billed
Your messages (including chat history) = input Tokens. AI replies = output Tokens. Both are billed.
✂️
Cost-SavingTip:Control Context Length
Don't let conversations grow indefinitely. Start fresh chats regularly to avoid sending large chat histories to the AI.
Troubleshooting

Troubleshoot How

🔴
401 Unauthorized
API Key Invalid or expired. Check if the Key was copied completely, no extra spaces.
🟡
429 Too Many Requests
Rate limit exceeded. Wait a few seconds and retry, or use sleep() to reduce frequency.
🔵
model not found
Wrong model name. Check the full model list at aitoken.sbs. Watch capitalization.
🟢
Insufficient Balance
Token When you run out, top up at aitoken.sbs. Credits arrive instantly.
🏆

All 3 LessonsDone

You've Mastered aitoken.sbs Core Usage

Lesson 1
Replace OpenAI API Basic Access
Lesson 2
Local Deployment ChatGPT Client
Lesson 3
Cost-SavingTip + ModelChoose + Debug
🚀
Next
Go to aitoken.sbs Top Up,Get Started
🎉 Go to aitoken.sbs Get Started