The model name format today is model:tag`. Some examples are `orca:3b-q4_1` and `llama2:70b`. The tag is optional and if not provided will default to `latest`. The tag is used to identify a specific version.
### Durations
All durations are in nanoseconds.
## Generate a Prompt
**POST /api/generate**
### Description
**Generate** is the main endpoint that you will use when working with Ollama. This is used to generate a response to a prompt sent to a model. This is a streaming endpoint, so will be a series of responses. The final response will include the context and what is usually seen in the output from verbose mode.
### Request
The **Generate** endpoint takes a JSON object with the following fields:
```JSON
{
"model": "site/namespace/model:tag",
"prompt": "You are a software engineer working on building docs for Ollama.",
"options": {
"temperature": 0.7,
}
}
```
**Options** can include any of the parameters listed in the [Modelfile](./modelfile.mdvalid-parameters-and-values) documentation. The only required parameter is **model**. If no **prompt** is provided, the model will generate a response to an empty prompt. If no **options** are provided, the model will use the default options from the Modelfile of the parent model.
### Response
The response is a stream of JSON objects with the following fields:
**Copy** will copy a model from one name to another. This is useful for creating a new model from an existing model. It is often used as the first step to renaming a model.
### Request
The **Copy** endpoint takes a JSON object with the following fields:
```JSON
{
"source": "modelname",
"destination": "newmodelname"
}
```
### Response
There is no response other than a 200 status code.
### Example
#### Request
```shell
curl -X POST 'http://localhost:11434/api/copy' -d \
'{
"source": "MyCoolModel",
"destination": "ADifferentModel"
}'
```
#### Response
No response is returned other than a 200 status code.
## Delete a Model
**DELETE /api/delete**
### Description
**Delete** will delete a model from the local machine. This is useful for cleaning up models that are no longer needed.
### Request
The **Delete** endpoint takes a JSON object with a single key/value pair for modelname. For example:
```JSON
{
"model": "modelname"
}
```
### Response
No response is returned other than a 200 status code.
No response is returned other than a 200 status code.
## Pull a Model
**POST /api/pull**
### Description
**Pull** will pull a model from a remote registry. This is useful for getting a model from the Ollama registry and in the future from alternate registries.
### Request
The **Pull** endpoint takes a JSON object with the following fields:
```JSON
{
"name": "modelname"
}
```
### Response
The response is a stream of JSON objects with the following format:
```JSON
{
"status":"downloading digestname",
"digest":"digestname",
"total":2142590208
}
```
### Example
#### Request
```shell
curl -X POST 'http://localhost:11434/api/pull' -d \