The autocomplete endpoint must return a JSON array in the format [{ value: 'CH', label: 'Switzerland' }, ...].
The value key is used to fill the input field and the label key is used to display the results.
You can decide which attribute is used to display the values and which one is used to fill the input field.
You can also have a separate field for the value. Usually hidden.