When a Local Model Is Slow, How Can Postman or Apidog Mock Its API?

January 2, 2025

I used Apifox often around that time and liked exploring interesting AI products. When I saw Postman’s AI offering, my first thought was whether Apifox had something similar. I also had a more practical question. Local inference was still poorly optimized. If all I wanted to know was whether my client could read a response or handle an error, could I mock the model API instead of running inference after every change? I came across Apidog while looking for answers.

How do I choose between Postman, Apidog and Apifox?

Apidog is an API development platform for design, documentation, debugging, mocking and automated tests. Apifox describes Apidog as a “sister product for overseas markets.”1 Their current terms name different providers. Apifox is provided by Guangzhou Ruihu Technology Co., Ltd. and/or its affiliates. Apidog’s contracting party is Apidog, Inc. Neither agreement specifies an ownership relationship.2 If you know Apifox, Apidog will feel familiar: both let you maintain request parameters, response fields and mock rules within one endpoint definition. Postman also supports sending requests, writing tests, sharing docs and serving mocks. A more useful selection question is whether your team already maintains runnable requests or a common API specification for frontend and backend developers.134

ToolHow would I test a model endpoint?When would I choose it?
PostmanSave the request and example success and rate-limit responses in a Collection. A Mock Server can reuse them. Once the real service is connected, reuse the requests and tests for regression testing.54The team already shares Collections, environment variables and test scripts, or wants to compare real model latency and token use with the LLM Comparison Collection.6
ApifoxSpecify the response structure in the endpoint documentation and save fixed examples or configure mock rules for test cases. The desktop client can serve a local mock to the frontend.78The team collaborates in Chinese, already keeps its API documentation in Apifox, and wants to resume integration testing immediately after editing a field.
ApidogGenerate mocks from the response structure, specify error responses with conditions and choose local or cloud hosting. With AI enabled and a model provider configured, it can also generate test cases from an API definition.910311An international team wants to maintain API definitions, mocks and tests together in English, or partners already collaborate in an Apidog project.1

For my immediate problem, sticking with the familiar Apifox was simplest. Have a local mock return a fixed answer and an HTTP 429 to the chat page, then test normal rendering and the rate-limit message. The model can be switched off. Postman’s model comparison tools become relevant when the question changes to “Which model answers the same prompt better, and how many tokens does it use?”76

What does each part do: the Apifox client, local mock and API Hub?

On January 2 I read a 2022 Juejin article by “一个幽默的程序员” comparing Apipost and Apifox. The author’s team had managed documentation in Swagger, prepared frontend test data with RAP and FastMock, and tested backend APIs in Postman. In the section on sharing documentation, the author wrote about Apifox’s ApiHub: “Apihub 给我们提供了许多非常优秀的文档案例。” (“ApiHub gives us many excellent examples of documentation.”) That suggested a concrete use: if you have no model API definition yet, see how other people document requests and responses in their public projects.8

For a chat endpoint, Apifox API Hub is where to find public projects. Read a suitable document there, or choose “Clone Project” to copy the API definition to your team. The Apifox desktop client edits and tests that definition. Running it locally still allows you to send requests to remote model services. The URL determines who answers.12

If the chat application sends its request to the local mock URL shown in the endpoint details, a local service running alongside the Apifox client receives it. It returns JSON from project examples or rules while the model is off. Quit the desktop client and the local address stops working. You can clone the definition from the Hub or write it yourself. To let colleagues continue testing after your computer shuts down, enable a cloud mock so Apifox’s servers supply the test response.7

Why do other tools also call themselves API Hub?

That afternoon I also read Apidog’s mock comparison, searched what is apihub, and opened pages from SmartBear and RapidAPI. Three products share the name, with different emphases.13

My questionTool and approach
Can I find an existing API definition to test myself?Apifox launched API Hub in 2021 for finding, visiting and cloning public API projects.14
As an API provider, how do I agree on a format and publish it?SmartBear’s SwaggerHub combines design, standards checks and documentation publishing. Teams can maintain an OpenAPI definition, check conventions and share it through a portal. It later became API Hub for Design within API Hub.1516
As a consumer, how do I find APIs my team can use?RapidAPI’s API Hub for Teams publishes internal APIs, controls which teams can access them, and centralizes subscriptions to third-party APIs. Internal API documentation pages also offer interactive tests and code examples.17

I also followed a link from Apifox’s homepage to OpenAI API documentation hosted on Apifox. Its project notes demonstrated entering an API key and clicking Send. The Completion Object page I opened next listed fields in the legacy Completions response, where generated text lives at choices[0].text. That told me what my client should read. To test the page while my local model was offline, I also needed a URL that returned data in that shape.1819

How do I test the model API client first?

A chat client needs a different field path. Suppose it calls a Chat Completions-compatible API without streaming and reads choices[0].message.content. Point the service address at the mock and keep the existing POST /v1/chat/completions request. To test just extracting and displaying the reply, the success example need contain only the fields the client reads:

{"choices":[{"message":{"role":"assistant","content":"这是一条用于调试的回答。"}}]}

This is a minimal example to illustrate the path. If the SDK validates a response type, model name or other fields, complete the structure it accepts. Prepare a second example for HTTP 429 at the same path to test the normal answer and rate-limit message separately. Both bypass local inference. Testing progressive text display requires simulating SSE events arriving in chunks. A single JSON response exercises only the non-streaming path.20

Preparing these two responses raises a practical maintenance question: when an API field changes, where must I update the mock? In the 2022 Juejin comparison, Apifox allowed the author to choose a mock rule from a dropdown next to each documented field. The version of Apipost the author tried required separate mock code, so documentation and test data needed two changes. That matters to a chat client when the answer moves from text to message.content.8

Another article I read that day compared Apidog and Postman using a simpler example: looking up a user. Suppose GET /users/42 returns a user with id and name, while GET /users/999 returns HTTP 404. Here is how the two tools control response content, using the documentation available in November 2026.13

What the frontend needs to checkPostman mock from a CollectionApidog mock from an API definition
Can I reproduce the same user consistently?Save a request example with a status and response body. Matching that example returns its saved content.5Save a response example on the endpoint and set the default mock mode to prioritize examples.9
How does the layout handle other names?Use a dynamic variable such as $randomFullName in the body’s name field. The example author chooses which fields vary.21Smart Mock generates data from the response schema. You can set generation rules for individual fields with domain meaning, such as a name.1310
What appears when a particular user is missing?Save a 404 example for /users/999. A test request can also send x-mock-response-code: 404 to filter saved examples.5Add a Mock Expectation whose condition is path parameter id equal to 999, and set the status and error body together in the rule.10

Fix one user or generate a different name every time?

To compare screenshots from two commits, fix user 42’s response at {"id":42,"name":"林安"}. In Postman, put the JSON in the saved request example. In Apidog there is an easy setting to miss. Even if the documentation says “林安,” prioritizing Smart Mock can still return a generated name. Example-first mode follows “Mock Expectation > Response Example > Smart Mock”. If a correct example keeps returning the wrong value, first check for a matching expectation, then the project’s priority setting.59

To see whether longer names break a card, keep id fixed and vary name alone. In Postman change one value in an existing example. Apidog works well when you start with a maintained response structure and tune the name field. Both generate random data. To reproduce an already-known overlong name, saving the exact string as a fixed example is more efficient than refreshing until it appears by chance.2110

How can the frontend reach its actual 404 branch?

First see whether the frontend request can stay unchanged. In Postman, save examples with the two concrete paths GET /users/42 and GET /users/999. The mock chooses the closest example by method, path and other request information. To alternate success and failure at one URL, save both 200 and 404 examples at that URL and send x-mock-response-code in the test request with the desired status. The header only filters existing examples, so save the 404 first.5

Apidog can encode “999 is a missing user” in a server-side mock expectation. The frontend requests /users/999 as usual and receives a 404 and the agreed error JSON on a match. The first matching expectation wins, so put a user-specific rule ahead of a catch-all. After configuration, send two requests. Use 999 to check the HTTP status and error message, then 42 to confirm a normal user still opens. This also catches a common mistake: the body says “user not found” but the status is still the default 200.10

When is it worth connecting a real model?

On February 11 I opened the January 22 issue of The Postman Drop, which introduced Postman AI Agent Builder. Its API Client’s AI protocol came closest to my original question: send input to a model and inspect the output directly. Its LLM Comparison Collection also runs one set of inputs against several models to compare answers, latency and token use. These figures require actual model calls. Running a fixed mock answer measures only how the client handles that answer.6

One step further, imagine an app that reads a support ticket, asks a model to categorize it, then updates its label through the ticket API. Postman Flows can connect model requests and API requests on a canvas. The same ticket example can then be tested twice. First give the client a fixed category and check that it sends the right update request. Then connect the model and see which category it chooses for an ambiguously worded ticket. Only the second round is worth waiting for inference.6

My initial question about whether Apifox itself had AI eventually got a specific answer. Version 2.7.18, released on June 20, 2025, allowed teams to configure a model provider’s API key and have AI fill in descriptions, Chinese names and mock rules for fields in a data model. Back in the chat example, AI can help write the field rules and the mock service can return client data accordingly. When I want to know how the model really answers, I switch the address back to the actual service.22

Footnotes

  1. Apifox. (2026). Choosing a Postman Alternative: Seven API Clients Compared in 2026. Apifox API Tips, part III, product 7 (“Apidog: Apifox’s sister product overseas”), first paragraph. Product relationship and intended teams ↩ ↩2 ↩3

  2. 广州睿狐科技有限公司. (2026, August 5). Service Agreement, preamble, clause 2. Apifox documentation; Apidog, Inc. (n.d.). Terms of Service, opening paragraph. Apidog Legal ↩

  3. Apidog. (n.d.). Mock API Data in Apidog. Apidog Docs, “Mock Server Types.” Local and cloud mocks ↩ ↩2

  4. Postman. (n.d.). Create a Postman mock server from a mock or a collection. Postman Docs. Create a mock from an existing Collection ↩ ↩2

  5. Postman. (n.d.). How a Postman mock server matches requests to saved examples. Postman Docs, “How it works.” Example matching rules ↩ ↩2 ↩3 ↩4 ↩5

  6. The Postman Team. (2025, January 22). The Postman Drop: Introducing the AI Agent Builder. Postman Community, opening post. Release announcement ↩ ↩2 ↩3 ↩4

  7. Apifox. (n.d.). Mock Data. Apifox documentation, “Mock Servers” and “Accessing a Mock Server.” How local and cloud mocks run ↩ ↩2 ↩3

  8. 一个幽默的程序员. (2022, July 8). Apipost or Apifox: Which Would You Choose?. Juejin, “Domestic Apifox” column. Team use in §2, “Clarifying Requirements,” editing mocks in §2.3, quotation in §3, “Sharing Documentation,” paragraph 1. Original article ↩ ↩2 ↩3

  9. Apidog. (2026, January 15). Mock Priority Sequence. Apidog Docs, “Mock Priority Options,” “Response Example First,” priority expression. Matching order with response examples first ↩ ↩2 ↩3

  10. Apidog. (2026, July 17). Custom Mock. Apidog Docs, “Conditional Responses,” “Dynamic Mock Data,” and “Advanced Response Properties.” Fields, conditions and status codes ↩ ↩2 ↩3 ↩4 ↩5

  11. Apidog. (n.d.). Overview of AI Features in Apidog. Apidog Docs. AI setup and test case generation ↩

  12. Apifox. (n.d.). API Hub. Apifox documentation, “Browse APIs.” View and clone public projects ↩

  13. Apidog. (n.d.). API Mocking in Postman v.s. Apidog: Which is Better? Apidog Articles, scenarios 1–3. Original article ↩ ↩2 ↩3

  14. Apifox. (2021, October 29). Changelog (version 1.4.10). Apifox documentation. API Hub launch entry ↩

  15. SmartBear. (2024, April 18). SmartBear Integrates API Tools to Enhance Design Experience for Teams. SmartBear News. SwaggerHub design, standards checks and portal ↩

  16. SmartBear. (2025, January 14). What’s New, entry for January 14, 2025. Swagger Support. API Hub for Design renaming entry ↩

  17. RapidAPI. (n.d.). What is API Hub for Teams? RapidAPI Docs, “For Internal APIs” and “For External APIs.” Managing internal and external APIs ↩

  18. OpenAI (ChatGPT) documentation project. (2026, May 28). Project Notes. Apifox, “Online Debugging”. Testing steps ↩

  19. OpenAI (ChatGPT) documentation project. (n.d.). Completions Object. Apifox. Response fields and examples ↩

  20. OpenAI. (n.d.). Chat Completions. OpenAI API Reference. Requests, responses and streaming ↩

  21. Postman. (n.d.). Generate dynamic mock server responses with variables. Postman Docs, “Dynamic variables.” Dynamic variables in example responses ↩ ↩2

  22. Apifox. (2025, June 20). Changelog (version 2.7.18). Apifox documentation. Release entry ↩

© 2025 borui. All rights reserved. This content may be freely reproduced, displayed, modified, or distributed with proper attribution to borui and a link to the article: borui (2025-01-02). When a Local Model Is Slow, How Can Postman or Apidog Mock Its API?. https://caiborui.com/blog/2025-01-02-zh-postman-apidog-api-mock-entrans

@misc{borui2025-dbc71610,
  author = {borui},
  title = {{When a Local Model Is Slow, How Can Postman or Apidog Mock Its API?}},
  year = {2025},
  publisher = {borui's blog},
  url = {https://caiborui.com/blog/2025-01-02-zh-postman-apidog-api-mock-entrans}
}