# US 2026/0099518 A1 · Model Based API Mocking

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0099518 A1
- Document ID: US20260099518A1
- Status: Published application
- Kind: A1
- Application number: 18/908,285
- Filed: 2024-10-07
- Published: 2026-04-09
- Earliest claimed: 2024-10-07
- Assignees: Scaled Cognition, Inc.
- Applicants: Scaled Cognition, Inc.
- Inventors: Mathew Gardner; Adam Pauls; Jordan DeLoach
- Web page: https://patentgrep.com/patent/US20260099518A1

## CPC

- G06F 16/33295: {in dialogue systems}
- H04L 51/02: using automatic reactions or user delegation, e.g. automatic replies or chatbot-generated messages
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

The present technology, roughly described, provides for mocking an application program interface (API) using a large language model (LLM). The present system generates a prompt with API signature information and API desired behavior information. The prompt can include instructions, library functions, examples, executed programs, and a current function invocation, as well as other content. The prompt can be generated, and submitted to an LLM to mock an API and generate a response. The response can be audited and the LLM can be fine tuned to provide improved performance in subsequent calls.

## Claims

### Claim 1

A method for mocking an application program interface, comprising:
generating, by a first application on a first server, an application program interface (API) signature for the API to be mocked;
generating, by the first application, a desired behavior for the API to be mocked; and
generating a prompt that includes the API signature, the API desired behavior, and world state data, the desired behavior including instructions to a machine learning model, the world state data including zero or more values related to an operation that initiated creation of the prompt, the zero or more values maintained on a second server remote from the first server;
submitting the prompt to a large language model LLM; and
receiving a response from the LLM based on the prompt, the LLM response mocking a response that would be provided by the API based on a call to the API using data contained within the prompt.

### Claim 2 (depends on 1)

The method of claim 1, wherein the API desired behavior includes examples of API inputs and outputs.

### Claim 3 (depends on 1)

The method of claim 1, wherein the API desired behavior includes constraints on API output.

### Claim 4 (depends on 3)

The method of claim 3, wherein the constraints include a selected format of the mocked API output.

### Claim 5 (depends on 3)

The method of claim 3, wherein the constraints include a specified format for a structured mocked API output.

### Claim 6 (depends on 1)

The method of claim 1, wherein the LLM is fine-tuned based on an audit of the LLM response.

### Claim 7 (depends on 1)

The method of claim 1, wherein the mocked API call is related to an interaction between an automated agent and a simulated customer.

### Claim 8

A non-transitory computer readable storage medium having embodied thereon a program, the program being executable by a processor to mocking an application program interface, the method comprising:
generating, by a first application on a first server, an application program interface (API) signature for the API to be mocked;
generating, by the first application, a desired behavior for the API to be mocked; and
generating a prompt that includes the API signature, the API desired behavior, and world state data, the desired behavior including instructions to a machine learning model, the world state data including zero or more values related to an operation that initiated creation of the prompt, the zero or more values maintained on a second server remote from the first server;
submitting the prompt to a large language model LLM; and
receiving a response from the LLM based on the prompt, the LLM response mocking a response that would be provided by the API based on a call to the API using data contained within the prompt.

### Claim 9 (depends on 8)

The non-transitory computer readable storage medium of claim of claim 8, wherein the API desired behavior includes examples of API inputs and outputs.

### Claim 10 (depends on 8)

The non-transitory computer readable storage medium of claim of claim 8, wherein the API desired behavior includes constraints on API output.

### Claim 11 (depends on 10)

The non-transitory computer readable storage medium of claim of claim 10, wherein the constraints include a selected format of the mocked API output.

### Claim 12 (depends on 10)

The non-transitory computer readable storage medium of claim of claim 10, wherein the constraints include a specified format for a structured mocked API output.

### Claim 13 (depends on 8)

The non-transitory computer readable storage medium of claim of claim 8, wherein the LLM is fine-tuned based on an audit of the LLM response.

### Claim 14 (depends on 8)

The non-transitory computer readable storage medium of claim of claim 8, wherein the mocked API call is related to an interaction between an automated agent and a simulated customer.

### Claim 15

A system for automatically rendering a prompt, comprising:
one or more servers, wherein each server includes a memory and a processor; and
one or more modules stored in the memory and executed by at least one of the one or more processors to generate, by a first application on a first server, an application program interface (API) signature for the API to be mocked, generate, by the first application, a desired behavior for the API to be mocked, generate a prompt that includes the API signature, the API desired behavior, and world state data, the desired behavior including instructions to a machine learning model, the world state data including one or more values related to an operation that initiated creation of the prompt, the one or more values maintained on a second server remote from the first server, submit the prompt to a large language model LLM, and receive a response from the LLM based on the prompt, the LLM response mocking a response that would be provided by the API based on a call to the API using data contained within the prompt.

### Claim 16 (depends on 15)

The system of claim 15, wherein the API desired behavior includes examples of API inputs and outputs.

### Claim 17 (depends on 15)

The system of claim 15, wherein the API desired behavior includes constraints on API output.

### Claim 18 (depends on 15)

The system of claim 15, wherein the constraints include a selected format of the mocked API output.

### Claim 19 (depends on 15)

The system of claim 15, wherein the constraints include a specified format for a structured mocked API output.

### Claim 20 (depends on 15)

The system of claim 15, wherein the LLM is fine-tuned based on an audit of the LLM response.
