Model Selection and Your First API Call: A Verification Workflow

Compare models with a real task, verify the exact model ID and billing unit, test the output online and make a minimal OpenAI-compatible API request.

HeFu · Published 2026-11-25 · Updated 2026-11-26

3 min read

Model selection works best when it begins with a real task and an acceptance check. The largest or cheapest model is not automatically the right choice for summarization, code, image understanding, long documents or structured extraction.

This workflow uses the HeFu live catalog and OpenAI-compatible API to move from task definition to a verifiable first request without saving a fixed model list or outdated price table.

1. Model Selection Starts with Testable Requirements

Choose a representative but sanitized input and write down four conditions:

  • Task type: text chat, code, vision, image, video, speech or embeddings.
  • Input and output size: approximate context length and the output needed for one useful result.
  • Quality check: required fields, runnable code, traceable facts or another acceptance criterion.
  • Cost and latency boundary: a small verification budget and an acceptable response-time range.

Use the same input for each candidate. Otherwise, differences in the prompt can look like differences in model quality.

2. Filter the Live Model Catalog

Open the live model catalog and narrow the list by capability and vendor. On each candidate’s detail page, verify:

FieldWhat to confirm
Model IDThe exact value used in the API model parameter
Capabilities and contextSupport for the input type and enough context for the real task
Billing unitTokens, images, duration, calls or another unit
Current rateInput, output, cached input and any applicable tiers
Online experienceWhether the selected model can be tested with the real input

HeFu live model catalog with capability filters and current model information

Models, rates and availability change. Use the catalog and cost calculator at the time of integration rather than copying values from an old article.

3. Compare the Output Before Writing Integration Code

Use the online experience to inspect answer quality with the same sanitized input. Save the selected model, prompt and output for each candidate so the comparison is reproducible.

For a programming task, run the generated code. For structured extraction, validate every required field. For a research task, check whether the answer exposes sources and whether those sources actually support the claim.

Online success is only one part of verification. The application still needs its own authentication, protocol, streaming, timeout and error-path tests. API Doctor can help with free preflight, client configuration and one explicitly confirmed compatibility check; it does not benchmark model quality or production reliability.

4. Make the First API Call

Create an API Key in the console and store it only in a server-side secret or a client’s protected credential area. Never place it in browser code, a public repository or a screenshot.

The following minimal request uses the OpenAI Chat Completions protocol. Replace <model-id> with the exact ID copied from the catalog:

export HEFU_API_KEY="your-server-side-key"
curl https://api.hefu.hk/v1/chat/completions \
  -H "Authorization: Bearer $HEFU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<model-id>","messages":[{"role":"user","content":"Explain what an API is in one sentence."}]}'

The request format, streaming options and other endpoints are documented in the HeFu API documentation. Start without tools or a complex system prompt so the first result is easy to diagnose.

5. Accept the Integration Before Production Use

Complete these checks before routing real traffic:

  1. The returned result meets the quality criterion defined before testing.
  2. Success, invalid credentials, unknown model, timeout and rate-limit paths have explicit handling.
  3. Streaming clients receive chunks correctly and handle the end of the stream.
  4. The console shows the request and its usage can be reconciled with wallet details.
  5. Production secrets can be rotated, usage alerts exist and any fallback has itself been tested.

For runnable examples, use the HeFu API examples on GitHub. Keep the sanitized test input and acceptance result with the integration so later model changes can be evaluated against the same baseline.

That produces a defensible model choice: current model ID, measured output quality, verified protocol behavior and observable usage—not a choice based only on a model name or a headline price.

FAQ

Can I use a model’s display name in the model parameter?

Do not guess from the display name. Copy the complete current model ID from the live catalog or model detail page, preserving its capitalization and separators.

If online chat works, is the API integration already verified?

No. You still need to verify authentication, request protocol, streaming behavior, error handling and console usage with your own API Key and application.

Should I choose the cheapest or largest model first?

Start with the task’s quality requirement, input type, context size, output budget and latency boundary. Compare candidates on the same sanitized input, then include actual usage in the decision.

Related reading

Next step

Start with a real task and a measurable acceptance check

Filter currently available models, verify the model ID and current billing unit, then follow the API documentation for a minimal request.

Browse the Live Model CatalogRead API docs