> This page is for version latest (default).
> For other versions, use one of these documentation indexes:
> - latest (default): https://docs.nvidia.com/alchemi/vasp/latest/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/alchemi/vasp/llms.txt.

# Submit a calculation asynchronously

POST http://localhost:8000/submit
Content-Type: application/json

Validate and submit a calculation, returning a request ID as soon as the input is accepted. Poll `/status/{request_id}` for progress and retrieve the result from `/result/{request_id}`.

Reference: https://docs.nvidia.com/alchemi/vasp/alchemi-qc-api/calculations/submit

## Request

### Body (application/json)

This endpoint expects a VASPRequest.

- `config` (VASPConfig, required) — Configuration settings that define how to launch VASP.
- `atoms` (AtomicData, optional, nullable) — Atomic structure to evaluate. Supply either this field or a `POSCAR` entry in `files`, but not both.
- `info` (string, optional, nullable) — Optional metadata string echoed back on the reply.
- `files` (map from string to VaspRequestFiles, optional) — Input files to pass to the service. Keys are file names; values are either the file contents as plaintext or a reference to a previously uploaded file. An `INCAR` entry is required.

## Response

### 200

The calculation was accepted for asynchronous execution.

- `request_id` (string, required) — Task ID for the request.
- `status_url` (string, required) — URL to retrieve the status of the task.
- `result_url` (string, required) — URL to retrieve the result of the task.

## Errors

### 422 Unprocessable Entity Error

The request failed validation.

- `detail` (string, required) — Human-readable description of the error.

### 500 Internal Server Error

The request could not be staged for execution.

- `detail` (string, required) — Human-readable description of the error.

## Types

### VASPConfig

Configuration that defines how VASP is launched for a calculation.

- `version` (enum, optional, default: std) — Which VASP executable to use: `std` for standard, `ncl` for non-collinear spins, `gam` for gamma-point only.
  - Allowed values: `std`, `ncl`, `gam`
- `potcar_type` (string, optional, default: PAW_PBE_64) — Which generation of POTCAR to use. Maps to a directory in the POTCAR library. Overridden when `potcar_defaults` is provided.
- `potcar_symbols` (list of string, optional, nullable) — Element symbols to use for the POTCAR file. The default POTCAR for an element shares its name, so only overrides need to be supplied (e.g. `Be_sv`).
- `potcar_defaults` (string, optional, nullable) — A preset list of pseudopotentials. Use `vasp-rec` for the recommended VASP set or the name of a pymatgen VaspInputSet. Cannot be combined with `potcar_symbols`.

### AtomicData

Software-agnostic description of an atomic structure.

- `coord` (list of double, required) — Atomic coordinates as a flat list [x1, y1, z1, x2, y2, z2, ...].
- `numbers` (list of integer, required) — Atomic numbers for each atom.
- `charge` (integer, optional, nullable, default: 0) — Total charge of the system.
- `mult` (integer, optional, nullable, default: 1) — Spin multiplicity (2S+1).
- `cell` (list of double, optional, nullable) — Unit cell as 9 elements in a flattened list.
- `pbc` (list of boolean, optional, default: [false,false,false]) — Periodic boundary condition flags for each cell vector.
- `structure_id` (string, optional, nullable, default: ) — Optional identifier for the structure.

### VaspRequestFiles

- string
- StagedInputFile: StagedInputFile

### StagedInputFile

Reference to an input file uploaded via `/input/upload`.

- `file_id` (string, required) — ID of an input file provided via the `/input/upload` endpoint.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "request_id": "b5e002d5-286b-44e0-b7c5-dd407bc461d3",
  "status_url": "http://localhost:8000/status/b5e002d5-286b-44e0-b7c5-dd407bc461d3",
  "result_url": "http://localhost:8000/result/b5e002d5-286b-44e0-b7c5-dd407bc461d3"
}
```

**SDK Code**

```python default
import requests

url = "http://localhost:8000/submit"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript default
const url = 'http://localhost:8000/submit';
const options = {method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go default
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8000/submit"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby default
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/submit")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java default
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8000/submit")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php default
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8000/submit', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp default
using RestSharp;

var client = new RestClient("http://localhost:8000/submit");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift default
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/submit")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```