# Rest API - Set CPU count

**URL:** <https://discourse.pollination.solutions/t/rest-api-set-cpu-count/2702>\
**Category:** Scripting\
**Tags:** question\
**Created:** [May 16, 2023, 9:57am UTC](https://discourse.pollination.solutions/t/rest-api-set-cpu-count/2702 "2023-05-16T09:57:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jriise](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/jriise/32/4952_2.png) [@jriise](https://discourse.pollination.solutions/u/jriise)\
**Post date:** [May 16, 2023, 9:57am UTC](https://discourse.pollination.solutions/t/rest-api-set-cpu-count/2702/1 "2023-05-16T09:57:35Z")

</div>

Need help setting the CPU parameters when calling the Pollination API. Any documentation on this topic?

I imagine there is a method to do this somewhere? Seeing an example would be very helpful.

Some context from my script:

```auto
if __name__ == ' __main__':
    project = Payload.Create(
        name=project_name,
        description='A test project',
        public=False
    )
    res: Any = create_project(client, project)
    print(res.json())
    recipe_filter: Payload.RecipeFilter = Payload.RecipeFilter(
        owner='ladybug-tools',
        name='annual-daylight',
        tag='0.9.13'
    )
    # ...
    job: Payload.Job = Payload.Job(source=recipe_source_url, arguments=arguments)
    res: Any = client.create_job(project.name, job)
    # ...

```

---

<div class="post-metadata">

**Author:** ![mostapha](https://discourse.pollination.solutions/user_avatar/discourse.pollination.solutions/mostapha/32/5761_2.png) [@mostapha](https://discourse.pollination.solutions/u/mostapha)\
**Post date:** [May 16, 2023, 2:55pm UTC](https://discourse.pollination.solutions/t/rest-api-set-cpu-count/2702/2 "2023-05-16T14:55:50Z")

</div>

Hi @jriise,

Here is a code sample that shows how to submit a study to Pollination using the API:

> [@Working with Pollination through Jupyter Lab](https://discourse.pollination.cloud/t/working-with-pollination-through-jupyter-lab/2008/3):
>
> Hi, @charliebrooker - Yes. You can use Python to do all of that. Since you only have a Professional account with a limited number of CPUs (48) you probably want to submit them in smaller chunks but you can change the code to do that. Here are a few notes: My suggestion is to upload all the files to your project first so you don’t have to upload them one by one as part of the script. You can simply use the path on your project to do that. This code assumes you have already created a project an…

The daylighting recipes have an input for `cpu_count` that can be used to set the number of CPUs for the run. See these lines in the code.

```auto
recipe_inputs = {
    'model': None,
    'model_id': None,
    'min-sensor-count': 1000,
    'cpu-count': 20 # you can set the number of CPUs here
}

```

Let me know if you have any other questions.
